Monday, 24 July 2006
|
| Controlling telnet via Visual Basic Eric Johnston 19:00:57 |
| | I want to access a modem equipment device over the internet by calling it with its IP address and then using telnet to log in to its text style management screen, send a few single character commands and download a page of traffic statistics every 5 minutes and display a running table of date/time and traffic load (transmit, receive, errors etc).
I have Visual Basic 2005 Express. What "add-in" is needed / recommended ?. Your advice would be most welcome.
Best regards, Eric.
|
| | 1 answer | Add comment |
|
| Search thorugh a list Michael 15:10:55 |
| | Hi,
I have a listbox about 300 lines long and a textbox with the search term in. I want to be able to find the line that term is in. Anyone know how I would go about it?
Thanks,
Michael
|
| | 4 answer | Add comment |
Saturday, 22 July 2006
|
| Controllng applications through serial port Holmes & Watson 23:17:19 |
| | Hi,
I am working on an idea for a data input device for the disabled in which values are tapped out on a board and sent to the serial port. Can somebody tell me if the following can be acheived with VB;
If mscomm (or other device) is used to capture the input can VB pass these values to another application such as a word processor?
Could the values be modified before sending them to the application? E.g if the serial port recieved 1 then 2 then 3 in succession, could the VB program send a previosly stored string, such as an address, to the application?
Could the VB program also control the mouse whilst still keeping the wordprocessor open?
Many thanks for your interest.
Mark
|
| | 2 answer | Add comment |
|
| On Error Resume Next Does Not Work In This Loop Newbie 17:53:35 |
| | Instead of just moving on to the next control when it finds a control that does not have a Text property, I get a message:
Error 438: Object doesn't support this property or method.
On Error Resume Next For Each cntlControl In Me.Controls If cntlControl.Tag = "Order" Then cntlControl.Text = "" End If Next cntlControl On Error GoTo 0
Isn't On Error Resume Next supposed to make it move on to the next control?
If not, how can I avoid this error without listing each control that has a text property?
Thank you.
|
| | 7 answers | Add comment |
|
| attn: henning - Thanks! - I Understood clearly! Guest 11:25:36 |
| | A Really BIG thank you to you Henning!!
A. Dalton
|
| | Add comment |
|
| Redundant - duplicate lines? WebBiz 07:52:37 |
| | I'm trying to prevent someone closing a form if invalid data is in a textbox that is suppose to take numbers.
My previous post dealt with controlling input. This one is when the textbox loses focus after someone used Copy and Paste to put the wrong type of information in the box (my previous code prevented wrong values typed in).
But this code seems like a waste:
Private Sub txtBBStdDev_LostFocus() 'Make sure there is a value in Standard Deviation If txtBBStdDev = "" Then
txtBBStdDev = 2 txtBBStdDev.SelStart = 0 txtBBStdDev.SelLength = Len(txtBBStdDev) txtBBStdDev.SetFocus
ElseIf Not IsNumeric(txtBBStdDev) Then
txtBBStdDev = 2 txtBBStdDev.SelStart = 0 txtBBStdDev.SelLength = Len(txtBBStdDev) txtBBStdDev.SetFocus
End If
End Sub
I'm repeating the same lines twice.
I would originally use an OR to do both tests in one line and then have just one set of code. But if txtBBSStdDev.text actually had "" in it, then IsNumeric(txtBBStdDev) would get an error.
But I'm sure there is a cleaner more efficient way to do this.
Any thoughts?
Thanks. Rick
|
| | 8 answers | Add comment |
|
| Help Please-Need 2 Prevent VB6 pgm From starting twice Guest 01:41:07 |
| | I have been trying to figure outhow to prevent my VB6 program from being started multiple times. I must not be as good with kework searches as I thought since I can't even find something similar in the Knowledge Base.
I have a VB6 Data Acces pgm and I want to check to see if it is already running before it starts up completely and opens all the related files. There is a memory overhead I am dealing with on some of the PC's and the app is quite large.
I'm trying to streamline all code and I would sure appreciate any help.
appname is DBacess.exe
Thanks, A. Dalton
|
| | 3 answer | Add comment |
|
| Test for Numbers in text box WebBiz 00:42:05 |
| | I know. I know. This is a very basic question. Please forgive me.
But I'm finding that you folks here seem to know more clever ways of doing things than what started out appearing obvious.
For example:
You have a text box that is only allowed to take numbers. A value from 1 to 100.
While the user is entering something into this textbox, you want to stop him from entering anything but a number (0 - 9). If he types a letter or some other character or control, nothing should happen from his point of view. If he types in 3 digits, it won't let him type in anymore (since 100 is the highest number allowed).
And even if he types only numbers but it is too high (ex: 458), that this number is automatically changed to a DEFAULT value (say 14) and highlighted to allow him to change it again if he wishes.
I'm assuming to start off with, I can do something like this:
========================================= Private Sub txtBBPeriod_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Or Len(txtBBPeriod) = 3 Then KeyAscii = 0 End If
If CInt(txtBBPeriod) > 100 Then txtBBPeriod = 14 txtBBPeriod.SelStart = 0 txtBBPeriod.SelLength = Len(txtBBPeriod) End If
End Sub
=========================================
That is what I came up with. Is there a better, more efficient way to handle these textbox tests?
Thanks. Rick
|
| | 6 answers | Add comment |
Friday, 21 July 2006
|
| Milliseconds Victor 23:24:32 |
| | A while ago I posted a message wrt. formatting a datetime variable to include milliseconds.
The problem is that VB's Format keyword does not support milliseconds.
The reason why I want to use milliseconds is because I have to add rows to a history table with a combined primary key defined as "ParcelID-TimeStamp"
The history table keeps a log of all changes to a parcel's status.
A scenario pops up where I add 2 rows to this table for the same ParcelId, but because the app processes them within a one second period, I end up with 2 rows with the same ID and datetime value eg. "MDZET00000516"-"2005-03-02 15:06:01.000"
This obviously leads to a primary key violation.
I have considered appending a random value (less than one thousand) to the datetime field, but then it is not a valid DateTime anymore.
Any suggestions?
|
| | 16 answers | Add comment |
|
| Re: henning - your referenced info not on my news server Henning 20:11:55 |
| | Untested http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=65732&lngWId=1
Google is a good friend From VBForums-ClassicVB by dee-u.
Method 1: You can read the PrevInstance property of the App object, if the value of this is True then another instance of the application is already running.
If your program starts with Sub Main, you can use this code to exit the program if another copy is already running: visual basic code:----------------------------------------------------------------------- -------'in sub main... If App.PrevInstance = True Then MsgBox "Already running...." Exit Sub End If ---------------------------------------------------------------------------- --For forms you need an extra piece of code to also close the form, the following code should be placed in Form_load: visual basic code:----------------------------------------------------------------------- -------'in form_load... If App.PrevInstance = True Then MsgBox "Already running...." Unload Me Exit Sub End If ---------------------------------------------------------------------------- --
Method 2: You can use the FindWindow API to search for open windows with your form caption.
Note that for this to work you must know the exact title to find, so if you change your window title within your program
(such as adding a file name, like Notepad does) then this will fail. Also, if other running programs have the same caption,
your program may not run at all.
visual basic code:----------------------------------------------------------------------- ------- Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Sub Main() Dim m_hWnd As Long
'Change Form1 to your form Caption. m_hWnd = FindWindow(vbNullString, "Form1") If m_hWnd > 0 Then MsgBox "Program " & App.Title & " is already running..." Exit Sub End If
'Change Form1 to your form name. Form1.Show End Sub
/Henning
|
| | Add comment |
|
| attn: henning - your referenced info not on my news server Guest 19:32:35 |
| | My news provider, newsguy, doesn't have the posts you talked about in your reply to me.
I searched "comp.lang.basic.visual" for your references. I am really interested in what you have to say.
A. Dalton
|
| | Add comment |
|
| List registered ActiveX controls in VB6 Mr 17:20:10 |
| | If I use Microsoft's OLE Viewer and expand the Controls node, I can get a list of the several hundred ActiveX controls that are registered on my system, like Microsoft MonthView Control etc. How can I get this list in VB6?
For about 20 of these controls with a given prefix, I'm going to use CreateObject and then TypeLib (TLIApplication) to get a list of the control's members.
|
| | 2 answer | Add comment |
|
| How to read the csv file in visual basic and update recoreds in oracle Guest 06:15:50 |
| | How to read the csv file in visual basic and update recoreds in oracle
suri2001_ap@yahoo.co.in |
| | Add comment |
Thursday, 20 July 2006
|
| Check File Exists Fastest WebBiz 20:47:05 |
| | Greetings.
I'm looking for all slow spots in my app.
When checking whether a file exists, is this the fastest way?
'==================== 'If ttclayout.atb exists, load it. '==================== If LenB(Dir$(App.Path & "\ttclayout.Atb")) <> 0 Then SSActiveToolBars1.LoadLayout App.Path & "\ttclayout.Atb" End If
Or is there a faster way to determine whether a file exists?
Thanks. Rick
|
| | 10 answers | Add comment |
|
| Restarting a VB6 program Martin Trump 18:10:18 |
| | Hi
In some older BASIC's there used to be a Restart command which wiped the slate clean and restarted the program from scratch. I'd like to do that in VB6. The program is all form code with perhaps a dozen subs. It starts with Form_Load.
The only way I can think of doing that is to have an error handler in the Form_Load code with a Resume <1st line of Form_Load code> and force an error to invoke it. Not pretty.
Is there a better way of doing this? TIA
Regards -- Martin Trump
|
| | 6 answers | Add comment |
|
| Can VB trim MP3 or other types of sound files? Guest 15:23:55 |
| | I want to know if I can use VB to create an application that can trim an MP3 file or other types of sound file according to the time I specify. For example, I would like to cut the MP3 file starting from 01:15:32 (or even ending at 03:20:30).
Is there any reference material or sample programs?
Thanks.
|
| | 1 answer | Add comment |
|
| Any suggestions on speeding up app? WebBiz 13:40:49 |
| | Greetings.
As my program has evolved (charting program), it has also become slower.
In short, this is a charting program for drawing price charts (OHLC and Candlestick).
Originally the bars didn't take long to draw. Now there is a delay before they appear.
I'm looking for ways to speed up my program. Is there a resource or something that can help me find the bottlenecks?
Thanks.
Rick
|
| | 4 answer | Add comment |
Wednesday, 19 July 2006
|
| Forbiden (403) using Winsock & VB6 Dudule 19:09:59 |
| | Hello,
Using WINSOCK in Visual basic 6 application, most of the time it is working fine, but with some URL's, i got 'ERROR 403 forbiden to access.....". These URL are working fine with IE6 and "Firefox 1.5" (for example: http://www.mozilla.org/ ).
Any idea ??
Regards
|
| | 4 answer | Add comment |
|
| How to disable Flash movie recorder using Visual Basic Guest 15:16:26 |
| | Hi all,
I have a VB testing software, I need to disable flash from recording the tests run in VB. Any ideas?
Thanks
O
|
| | Add comment |
|
| HTML 'ge't in vb6 Pemo 14:31:56 |
| | I'd like to simulate a HTML form's ability to do a http 'get' request - does the inet control support this kind of thing, or is there some other method that's used please?
|
| | 3 answer | Add comment |
|
| MS buying Winternals Mayayana 14:20:19 |
| | For anyone who may not have heard, Winternals has sold out to Microsoft. It might be a good time to download the latest sysinternals.com utilities before MS gets their hands on them. (I was just at the site. It's not loading very well presently. This story has been covered by Slashdot, so it's probably generating a lot of traffic.)
Presumably this will also be the end of Mark Russinovich's clear-spoken blog articles. His serious criticism of .Net bloat will surely get lost in the shuffle once sysinternals is officially an MS site:
http://www.sysinternals.com/blog/2005/04/coming-net-world-im-scared.html
|
| | 1 answer | Add comment |
|
| device manager Johnno 11:53:29 |
| | I asked for some help a little while ago and didn't explain what I was after well enough. What I want to be able to do is use an API to obtain information about my installed cd / dvd drives. I'd like to be able to get the info in the same form that the device manager displays it: i.e. the manufacturer and / or model. Is there such an API call? Johnno.
|
| | 2 answer | Add comment |
|
| Computer of the net Wintelweb 11:18:29 |
| | It is possible to know when a customer connects itself or she is d3connectered on a computer of the net?
|
| | 11 answers | Add comment |
|
| File Name Spider 05:31:36 |
| | How can i tell if a file name is a full path name as opposed to just the name of a file, i.e. somefile.txt?
-- Spider
|
| | 11 answers | Add comment |
Tuesday, 18 July 2006
|
| RaiseEvent from dll Gertjan Huiskes 13:02:23 |
| | Hello all,
Is it possible to raise an event from a dll?
I have a dll, written in C, from where I want to raise an event in VB. I have source of both app
Gertjan
|
| | 3 answer | Add comment |
|