Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Isdestinationreachable Returning False Positives...


OK I'm at a loss here, I'm trying to simply determine if a computer is on the LAN with the following code:

Private Declare Function IsDestinationReachable Lib "SENSAPI.DLL" Alias "IsDestinationReachableA" (ByVal lpszDestination As String, ByRef lpQOCInfo As QOCINFO) As Long

Const NETWORK_ALIVE_AOL = &H4
Const NETWORK_ALIVE_LAN = &H1
Const NETWORK_ALIVE_WAN = &H2
Private Type QOCINFO
dwSize As Long
dwFlags As Long
dwInSpeed As Long 'in bytes/second
dwOutSpeed As Long 'in bytes/second
End Type

Private Sub cmdcheckip_Click()
Dim Ret As QOCINFO
Ret.dwSize = Len(Ret)


If IsDestinationReachable(txtcompname.Text, Ret) = 0 Then
MsgBox "The destination cannot be reached."
Else
MsgBox "Machine " & txtcompname.Text & " was reached."
End If
End Sub




Private Sub cmdexit_Click()
Unload Me
End Sub


Trouble is, with a lot of valid computer names it is still responding! If I put in some arbitrary name it returns false, so it seems like it is kind of working, but for a number of machines I have tested it on it will return true even if they are off! Anybody have any ideas?
Tom




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Why Does This Query Return Some False Positives?
open the DB click on best match query, and just hit OK wihtout specifying a product.
 
the reactive sites and reactivity should match up... which they do, and the prod PH should match the dye PH within +/-1 ... if you look it works for everything but robamine and calcium
 
Any ideas..? Why does the query return mostly the right values, and some blatently wrong values.. either it should work all the time or not work all the time. Any help would be much appreciated.



Edited by - AbbydonKrafts on 11/12/2006 4:41:17 PM

VB6 - DLL Returning Boolean True False
I have a vb6 dll that returns a boolean value when I call "EvaluateFile".

I am trying to test the return value inside a script.
I am not sure but I always get back a value of false.

I have tested the dll inside a vb6 program and it returns true/false correctly.

Only inside a script does it always return false.

This is my first time writing dll's or using scripting.

Here is the script that calls the dll

option explicit

dim objImport
dim bImport

Set objImport = WScript.CreateObject("banImp.Importer")

If objImport.EvaluateFile Then
WScript.Echo "Uploading file "
objImport.LoadData
WScript.Echo "Upload complete."
Else
WScript.Echo "There was no data to import."
End If

WScript.DisconnectObject objImport
Set objImport = Nothing


I always end up inside the Else

Any suggestions

Data.GetFormat(1) - Txt File Returning False?
Im using a picbox.. and checking the format for text file..
its returning false?? but it will pass when checking if its a list of files

Data.GetFormat(VbCFText) = False
Data.GetFormat(VbCFFiles) = True

It is a text file!???

IsDestinationReachable
Hi,

I'm having a Problem with the API "IsDestinationReachable". I'm using the following code to determin if a computer is online or not:


Code:
Private Declare Function IsDestinationReachable Lib _
"Sensapi.dll" Alias "IsDestinationReachableA" _
(ByVal lpszDestination As String, _
lpQOCInfo As QOCINFO) As Long

Private Type QOCINFO
dwSize As Long
dwFlags As Long
dwInSpeed As Long
dwOutSpeed As Long
End Type

Code:
Public Function Ping(ByVal IP As String) As Boolean
Dim QuestStruct As QOCINFO
Dim lReturn As Long

QuestStruct.dwSize = Len(QuestStruct)

lReturn = IsDestinationReachable(IP, QuestStruct)

If lReturn = 1 Then
Ping = True
Else
Ping = False
End If
End Function

As long as I "ping" with an UNC name everything works fine, I get True when the computer is online, False when it is offline.

But when I "ping" with an IP address I allways get back True. The only way I get back False is to unplug the network cable.

Now the problem is, I have to ping with the IP address.

Is this kind ov behavior normal? Can anybody help?

Michael

Does 'IsDestinationReachable' API Call Support Network Address Translation
Hi,

Could anybody please tell me if they know if 'IsDestinationReachable' API call support Network Address Translation ?
I have written a program in VB6 that needs to PING numerous PC's prior to mapping.

I am passing the IP address and QOCINFO as parameters for 'IsDestinationReachable', which works fine for the PC's not on the NAT'd network.

However the PING fails if the PC is using Network Address Translation.
I can ping the NAT'd IP address using the PING command, from the cmd prompt on my PC, so I know that the destination is reachable.

Any help would be very much appreciated on resolving this matter.

The code needs to be written in VB6.

Thanks in advance.

Your Opinion Please .Enabled = False VS .Visible = False ? What Is Better?
I have an application that has the option of locking the workstation, however this feature is not available for Win95 machines. Should I .enabled = false or .visible = false in the toolbar and menu on Win95 machines?

This is basically a question on taste and opinion

Recordset Only Returning Five Records When It Should Be Returning 466
All,

Doing this in excel with VBA. Haven't working in VBA for a very long time but can't see why I'm getting these results.

I run this sql in query analizer and I get 466 records back but when the same sql runs in vba I only get five records back. I checked the conn string to make sure I was running against the correct db. Is it that I'm not setting up my recordset object correctly?

Code:
Set conSql = New ADODB.Connection
    conSql.Provider = "SQLOLEDB"
    conSql.ConnectionString = "Data Source = Test1;" & "User ID=sa;Password=test; Initial Catalog = test;"
    'conSql.ConnectionTimeout = 120
    conSql.Open
    
    Dim strSql As String
    Dim fldField As ADODB.Field
    Dim docXML As New MSXML2.DOMDocument
    Set rstData = New ADODB.Recordset
    
    strSql = "SELECT CedingCoID, effectivedate, XMLString " & _
                "FROM CAPSProgram " & _
                "Where ID > 1 and CedingCoID > 1" _
          ' "WHERE (CedingCoID = '" & intCedingCoID & "' AND EffectiveDate = '" & CDate(datEffectiveDate) & "' AND Description " & IIf(strDescription = vbNullString, "IS NULL)", " = '" & strDescription & "')")

    rstData.Open strSql, conSql, adOpenForwardOnly, adLockReadOnly
    'Set rstData = conSql.Execute(strSql)
    Do Until rstData.EOF
       ' If Not rstData.EOF Then
            globEffectiveDate = rstData.Fields("effectivedate").Value 'set global effective date for future use
            docXML.LoadXML (rstData.Fields("XMLString").Value) 'load glabal xmldoc for all load routines
            globCedingCoID = rstData.Fields("CedingCoID").Value
              Call LoadCapsProgram(docXML)
            Call LoadCapsLossHisEvents(docXML)
            
            
        'End If
      rstData.MoveNext
    Loop
    

False Key
Hi

SendKeys HdSt = "fjols", True

This line give me false, why )

If ((3 And 4) = False) Then
I am so confused!

Please explain why the following if statement is FALSE?

If (3 And 4) Then
msgbox ("True") 'will not come here and why?
else
msgbox ("False") 'Will come here always
end if

Thanks

Why Is This False?
If I use this code it comes out false. Why?

(0.0087 * 100) = 0.87

If I encapsulate each side of the equation with Val() it comes out true.

Is it something to do with a floating decimal point?

Help

EOF Always False
Hello,
I am using ADO to access a Microsoft Access 2000 database. I can traverse the entire recordset, but eof is never set to true. Someone posted a similar problem with ADO.NET.

Any suggestions?

Moving A From = False
ow can i limit the user from draging a form....i have a midiform and i have a toolbar on the left...how can i have it locked from being moved?
thanks-tim

True And False: Are They Mad??
Hello,

suppose to write this very simple application:


Code:
MsgBox False
MsgBox True

Now I run it into my VB6 I see first a dialog box which displays "True" followed by "False".
Now I compile it and run the .exe. I see first a dialog box which displays "Vero" followed by "Falso". "Vero" and "Falso" are the italian equivalent of True and False.

Since I use to populate the results of boolean ( ) functions directly into some sql string, this sql results to be incorrect because the sql engine doesn't recognize the string "Vero" or "Falso" where was expecting a real boolean value.

Any one has as clue for this strange behavior? On my same pc, a about two weeks ago and since two years I never got this problem and now!!!

My os is W2K in EN but Internation settings are for Italy like last 4 years!

Please...i'm getting crazy

Cmd.visible = False
Hi
Let say i have 20 Cmd and in the form load i want all of them be False is there is any easy code to write instade of write them all

other Q

i also have 8 Timer's and in each Timer there is a Long Code is there any way to make each Timer as Function and i can call it any Time i need it

Jamal

Enabled = False
Hi is their a way when a text box is disabled (e.g, txtNames.Enabled = False) can you change the colour of the text.

At present mine always turn to a dull grey!!

If not is their any way around this.

Thanks

Showintaskbar=false But It's Still There! :(
Hi!
I got my form with showintaskbar=false but I can see it there! its in the taskbar, how can I show and hide it from taksbar at runtime?
Tnx

True Or False
vb Code:
Dim ret As Boolean' some other coderet = FtpPutFile(server, fname, fname, FTP_TRANSFER_TYPE_BINARY, 0)If Not ret Then myip = ""' more code  

when i declare ret like this the myip = "" runs everytime regardless of whether ret is true or false
if i don't declare ret and leave it to vb to cast it as a variant then ret will still return true or false and the if statement runs correctly

what logic am i missing about declaring ret?

Visible=false
what's wrong with the code below?

VB Code:
Private Sub Timer1_Timer()Label1.Left = Label1.Left + 100If Label1.Left = 300 ThenIf Label1.Left >= Text1.Left Then Text1.Visible = FalseIf Label1.Left >= Text2.Left Then Text2.Visible = FalseIf Label1.Left >= Text3.Left Then Text3.Visible = False Label1.Left = 10Label1.Top = Label1.Top + 50End IfIf Label1.Top = 200 Then Timer1.Enabled = FalseEnd Sub

Not True Or False, But Nothing
When VB first starts all boolean variables are nothing (ie not True and not False)

how do i set a boolean variable to nothing

ILMV

False E-Mail
My freind needs to send an attachment to an e-mail Word.doc to his boss of work he should have completed weeks ago.

How would it be possible to send a bogus file that is totaly unreadable and wont open up on word or alternativly open up as the word doc and show binary code or somthing like that?

This is only to give him one more day to complete the work

Any help would be greatful


spud

.ControlBox = False
Someone want to explain to me why this is not allowed at runtime?


Code:
Me.ControlBox = False


Why shouldn't i be allowed to remove the control box? Doesn't make any sense.

Anyone have any ideas how i might be able to overcome this?

Set Function To False
I need to know Set Function Rebate to False.
I have tried below code but it did not work.

Each time i press undo button. It prompt me,
Gross Is Missing before perform another function

How am i suppose to avoid this?


VB Code:
Public Function Rebate(FormName As Form)If FormName.txtGross = "" ThenMsgBox "Gross  Is Missing", vbCritical, "Data Missing"Exit FunctionElseFormName.txtrebateamt = CDbl(FormName.mskrebate) * CDbl(FormName.txtGross) / 100Exit FunctionEnd IfEnd Function



VB Code:
Private Sub cmdUndo_Click()If ClearAll(FrmPoliCreate) ThenRebate FrmPoliCreate = False ' did not work as well'rebate(Frmpoli Create) = false ' did not work as wellEnd IfcmdUndo.Enabled = FalseEnd Sub

ECHO(FALSE) In VBA
Can anyone tell me what equivalent of ECHO(FALSE) in Excel 4 macro language is in VBA.
Thanks
Mick

Locked = False
I have a program that has 200 items on the form, they being textboxes. cboboxes etc.. I have set all them as locked = false, as I don't want anyone to change the values in the boxes until an add button, or edit button is pressed.
In my cmdAdd procedure I have the following code:

txtOne.Locked = False
txtTwo.Locked = False
txtThree.Locked = False etc...

Is there a one line of code I can use , instead of writing all this code in. I know I can copy and paste.

I have seen Set_All_Locks somewhere, I don't know if is VB code proper or someone's own.

Thanks

Enabled = False
Hello,

Is it possible to change the color of a font when I set its enabled property to False?


Thanks.


Deju

For I = 1 To 300 Optionbutton(i) = False Next???
How do I get this working when I have a couple of hundred optionboxes?

Can anyone help??

MAPISEND FALSE
I have a little program that is to send emails with attachment to an email address. The MAPIMessage and MAPISession code work great and will send out emails to the identified addresses. M issue is when I use the program with "send false" I expect tha Outlook Express will send without using the interface. This i great but before it sends the email, OE produces a pop-up bo alerting me that a program is attempting to send the followin email message on my behalf, prompting "Would you like to sen the message? Send or not.. this is on a box running Windows X and defeats the whole purpose of being able to send without th user interface. Have I missed some value in my code to avoi this troublesome pop-up?

Help is appreciated.

HideSelection = False
ITtoolbox Portal for Visual Basic - http://visualbasic.ittoolbox.com/

Greetings,

Old programmer here, new to VB and to this list. Developing my first VB
project, getting my feet wet...

When I set HideSelection = False, I expect text box text to remain in
selected color under all conditions, but when I set Locked = True or Enabled
= False, colors are grayed out, which is not what I need.

Any enlightenment greatly appreciated. Thanks in advance. Happy Monday!

...Ralph Lynch



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

Using True Or False
I am sorry that this is long but i need your help!!
       Ok, I have no clue what i am doing wrong. My first form works but my second one doesnt. See, i am programming a multiple choice quiz. I am using option buttons for the choices. When you select the answer you want it will tel you if you are correct or wrong. Then after 3 seconds it will go to the next question with is on the second form. Once you click on the command button that is named EnterAnswer it will bring you to the next question/form. I can get to the second question but on the second question, it wont even tell me if i am right or wrong. Here is the code for the command button that will bring you to the second question:
Code:
Private Sub Cammand1_Click()
Select Case True
Case Option1.Value = True
Label2 = "Correct!"
Timer1.Enabled = True
EnterAnswer.Enabled = False
Case Option2.Value = False
Label2 = "Sorry Wrong Answer!"
Timer1.Enabled = True
EnterAnswer.Enabled = False
Case Option3.Value = False
Label2 = "Sorry Wrong Answer!"
Timer1.Enabled = True
EnterAnswer.Enabled = False
End Select
End Sub

And it works... it goes to question2. The code for the command button that leads you to question 3 is:
Code:
Private Sub Command1_Click()
Select Case True
Case Option1.Value = False
Label4 = "Sorry Wrong Answer!"
Timer2.Enabled
EnterAnswer2.Enabled = False
Case Option2.Value = True
Label4 = "Correct!"
Timer2.Enabled = True
Case Option3.Value = False
Label4 = "Sorry Wrong Answer!"
Timer2.Enabled = True
EnterAnswer2.Enabled = False
End Select
End Sub
EnterAnswer2 = False

AND IT DOESN'T WORK!!! I dont know why! They Are both exactly the same and i cant find a single problem!! When i click on the command it doesn't even do ANYTHING!!!!! Any ways, i am sorry that this was long but i despretally need help!!!

Set MIDChild = False At Runtime
i am trying to make an irc style chat client

the problem i have is by default i laod the room windows as MDI Children.

i am wanting to know how i can change the forms mdi state at run time...

so i can set the mdichild = true or false at runetime

can someone please help me ?

String To Represent False
I am using a formula for a cell and the formula is the syntax of If(cell#, true, false) . If the cell comes back false I want to display a string. I am trying: =If(H28, (my formula), "Error") and I am gettin a syntax error. How can I make the false represent a string?

Even I Set Visible To True But Still Is FALSE
Anyone can help me solve???

Run-time error '5':
Invalid procedure call or argument

the error occur at :
txtStk(2).SetFocus

even i set below statement before the error statement but still same:
txtStk(2).Visible = True

in immediate window i type ?txtStk(2).Visible but it show False even i set it to true.

WHY???
Edit by Moderator:

Quote:




Anyoen can HEP!!!! URGENT!!! even i set visible to true but still is FALSE




Please review this link: http://www.xtremevbtalk.com/showpost...0&postcount=11

Thank you.

How To Make Many Optionbutton False
I placed many optionbuttun on sheet

I want to do this code to include all optionbutton
optionbutton1.value= false

another thing where can I put this code to work when I run (open) my file (exl)

IF Function W/true && False
Excel 97-2000

I need to compare 2 conditions, do a calculation if True or if false print the text "--". The calculation works fine, but I canNOT get a false result to print. Here is the the code (excluding "--":

=IF(B4>999;B4<5000)*($Sheet3.B13*D3)*B4

If B4 is more than 999 and less than 5000 it will calculate. If B4 is not in the 999 - 5,000 range it returns 0 (zero); with =IF(B4>999;B4<5000) it returns false.

How do I adjust it so a false prints "--"?

TIA,

Bob

Application.EnableEvents = False
Hi everyone!

A recurring problem I am running into is userforms with a bunch of controls, each of them having a "change" event, and each of them interacting with each other.

I thought the Application.EnableEvents property would help me, but I can't get it to do what I thought it should be doing. Let's illustrate with a form that contains a textbox "TextBox1", and the following code:


Code:
Private Sub TextBox1_Change()
TextBox1.Text = "This has been changed"
End Sub
Private Sub userform_Activate()
Application.EnableEvents = False
TextBox1.Text = "Initial Text"
Application.EnableEvents = True
End Sub

What I thought this would do: when you .show the form, it starts with the "initialize" event which disables events, and so I expected the textbox to contain "Initial Text". Instead of that, the event TextBox1_change is called, in spite of the enableevents=false, and the textbox contains "This has been changed".

What am I not understanding, and/or doing wrong?

Thanks in advance!

Mathias

Code Gets Executed Even If The Value Is False ??
Hello,
Here is a sample of my code...


Code:
Dim IP(0 To 1000) As String

For Y = 0 to wskServer.Ubound
If wskServer(Y).State = 8
wskServer(Y).Close
IP(Y) = ""
Unload wskServer(Y)
DoEvents
End If
Next
...
For I = 1 to wskServer.Ubound
If IP(I) <> "" Then
...
End If
Next
Now the problem is that the IP(I) = "" BUT the code gets executed anyway...

Anyway to solve this ?

Thanks!

IF + 2 Conditions + AND + Exit If First Is False
Hello,

sorry for that subject - The actual question is a lot easier than to describe it in one line.
The question results from a nice feature I learned programming JAVA:
If you have an if-clause with two AND-conditions (e.g. if ((a == b) && (a != 1)) ) then JAVA will stop evaluating the conditions as soon as it notices that "a" does not equal "b".
The same works for OR-conditions when JAVA finds the first comparison to return true.
What would I need this for?
Well, when I work with databases e.g. I have to make a difference between NULL and "", because NULL can not be converted to any data-type.
Let's say I would like to compare a database text-field containing a date (I know, misconception, it's just an example) with 2003/01/27. First I need to check if the database actually contains a value, then convert it to date and compare:
if ((Not IsNull(rsData.fields("datefield"))) And (CDate(rsData.fields("datefield") = date_2003_01_27)) then ...

In the past I had to accept, that this statement throws an exception if datefield contains NULL, because VB does not exit the IF although the first part is allready false - Then, of course, CDate tries to convert a NULL-value which it can't.
Is there any tweak I can use as a work-around except reading the database-fields with default-values?

Thanx !

Rouven

FlexGrid1.Enabled = False
Hi

Q

How to set only the First Row 2 be Ebabled False

If i use this code it return all the Row's to be False

Code

FlexGrid1.Enabled = False

Jamal

Visible=false Not Working
Hi:

I'm using the following code to pause processing for 15 seconds and to display a message and a count on my form to tell the user what's going on and how long of a wait is left:

Label4.Visible = True ' show label on form
Label4.Refresh
interval = 15 ' set time to wait
Text3 = interval ' write time left to form
Text3.Visible = True
Text3.Refresh
sinTime = Timer ' initialize (seconds since midnight)
For i = 1 To interval
Do Until Timer - 1 > sinTime ' allow ~ 1 sec to pass
Loop
sinTime = sinTime + 1 ' set for next pass
Text3 = Text3 - 1 ' adjust time left
Text3.Refresh ' insure it shows on form
Next i
' done pausing - clean up and continue processing
Label4.Visible = False ' take label off form
Label4.Refresh
Text3.Visible = False ' take time left off form
Text3.Refresh

It works OK, except the message and count doesn't disappear from my form when the .visible=false and .refresh are executed at the end.

Any ideas why not?

True / False Values
Hello!

As far as I know, C stores False as 0 and True as 1. How about VB?

Set Field Values To False
How do I set the field values to False using Alter Table? I am using VB6 with MS Access DB.

The following gives me an error:

-2147217900,"[Microsoft][ODBC Microsoft Access Driver] Syntax error in CONSTRAINT clause.","This error created on:",#2006-01-18 08:01:08#



Code:
Call CreateConnection(objConn)
objConn.Execute "ALTER TABLE Documents ADD n_wavBol TEXT(50) CONSTRAINT n_wavBol_default DEFAULT False"
Call CloseConnection(objConn)

Docmd.Setwarnings False
If i use form (by itself) in the following manner and generate a primary key violation, the standard Access error message is NOT displayed (as it should not) and the Error Handler changes the invoice to "NEW INVOICE". Everything works fine!

Private Sub Command22_Click()

On Error GoTo Err_Command22_Click

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70


Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
InvNo = "NEWINVOICE"
Resume Exit_Command22_Click

End Sub

But when the form in question is a SUBFORM....no matter what I do, when there is a key violation, the standard Access message comes on, so it appears that the docmd.setwarnings False line does not work. Please help.

YES/NO Display As True/false
Greetings:

In use Access 2000, ADO 2.7, VB6; I have the following scenario: I have a field defined as yes/no, I create a recordset and display it using MSFlexgrid.

The fields display as true, false depending on their content. What I would like to happen is that they display as YES or NO. I don't want to update the datebase, just display yes or no.

What I tried to do is before passing the record set to the grid, was to loop thru the recordset, testing for true/false and depending on the content move "YES" to the field if true else "NO" if false.

That obviously did not work: I get an error message:

-2147217887; Source: Microsoft Cursor Engine;
Multiple-step operation generated errors. Check each status value.

Can someone shed some light on how I would go about achieving my goal of "YES" or "NO" displayed in the grid?


I thank you guys in advance for your help

Donald

As follows the code I tried:


Code:
adoVehiclesRs.MoveFirst
Do While Not adoVehiclesRs.EOF

If (adoVehiclesRs.Fields("AllowSmoking") = True) Then
adoVehiclesRs.Fields("AllowSmoking") = "Yes"
Else
adoVehiclesRs.Fields("AllowSmoking") = "No"
End If

adoVehiclesRs.MoveNext
Loop

MmcAudio.Enabled = False?
I need to make mmcAudio stop playing the audio sequence when "Form2" is Form2.Enabled = False. Yes, I know that is should stop playing when that is executed, but it isn't stopping. Infact it is still playing the sequence throughout the whole project after I have finished with it.

However I want it to only play when "Form2.Visible = True" and "Form2.Enabled = True".

ZwUnmapViewOfSection? False Positive?
I'm trying to create a program using the API:

Code:
Private Declare Function ZwUnmapViewOfSection Lib "ntdll.dll" (ByVal hProcess As Long, ByVal BaseAddress As Long) As Long


But, if I put the declaration in my code, my antivirus software keeps calling it a "HEUR/Malware", even if I don't call it. I was planning on comercially releasing the software, but I don't want it to be detected. Is there any other way then using a software protector such as "software passport armadillo".

Thanks.

Enabled=true/false
I have a timer and when it is counting i want a button to be disabled but when the timer stops i want the buttons to be enabled i was using the following code which disabled the button but then doesnt enable it once the timer stops. The code is
vb Code:
Private Sub Command1_Click()If Timer5.Enabled = True ThenCommand1.Enabled = FalseElseCommand1.Enabled = TrueDim i As Long    For i = 0 To 5        If Picture1(i).Visible And Picture2(i).Visible Then            Label3.Caption = Val(Label3.Caption) + 1            Exit For        End If    Next i    End IfEnd Sub    Private Sub Timer5_Timer()Picture3.Visible = FalsePicture4.Visible = FalseTimer5.Enabled = FalseEnd Sub



What is wrong with this code. Also can soemone tell me the code for when the button is clicked it cant be clicked again. Until something happens.

Thanks

Jamie

PortOpen = False On EXIT ?
Hello,

My program is running well , bet when I exit my program and go to a other program that need the comport I have just used , the other program tell me "Port in use"

I add a button .PortOpen = False , now it work , but I would like that this happens when I press the CLOSE or EXIT button from my form.

Any "On_Exit" or "On_Close" Command ?

Best Regards,
Didier.


VB Code:
ublic Function CommSelect(x As Integer) As StringWith ctlMSComm 'configuration du portIf .PortOpen = True Then .PortOpen = False.CommPort = x 'On utilise le port COM1:.Handshaking = 0.RTSEnable = 0.Settings = "9600,n,8,1".SThreshold = 0.InBufferCount = 0.InBufferSize = 1.OutBufferSize = 1.InputMode = 0.InputLen = 1.RThreshold = 1.SThreshold = 1On Error GoTo Comms_Error.PortOpen = TrueExit FunctionComms_Error:    If Err = 8002 Then    ' Port already open        MsgBox "Sorry, No Com" & x    End If    Resume NextEnd WithEnd Function

UseMnemonic In MENUS To FALSE ?
Hello,

Is there a way to display the & character on a menu item.. just as if you could disable this on a label by changing the UseMnemonic option.... is this possible on a menu item?

Using Objects [False Alarm]
I have a small number of checkboxes (not forming an array) chk1, chk2, chk3 and chk4. Each one of these must be moved to a specific place on the form and I would like to use a dummy checkbox for the matter, but the code below doesn't work (produces an error):

VB Code:
Dim ch As CheckBox'N (1 -> 4) is selected by the userSelect case N    Case 1        Set ch = chk1    Case 2        Set ch = chk2    Case 3        Set ch = chk3    Case 4        Set ch = chk4End Select'offset has already been initializedch.Left = offset(N)

Copyright 2005-08 www.BigResource.com, All rights reserved