Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing Port
Message
From
19/11/2003 06:37:53
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00850804
Message ID:
00851332
Views:
9
>Hi,
>
>>
>Thanks for tips. Unfortunately, in my case, if Comm Port 1 is opened and when I use oComm.PortOpen = .F. after issuing oComm.CommPort = 1, it still opened. Is there a win32 api function that will force specific port to close. Thanks
>>
>
>I think at the API level you'd be using CloseHandle(HANDLE) but MSCOMM doesn't expose it's handle and, IAC, would probably not be too happy about having it ripped out from under it. Maybe the answer lies, as Jim suggests, in clearing up any buffers etc before attempting the close.
>
>If you decide you need to handle all communications thru API calls then there's a MSDN article "Serial Communications in Win32" that will help..
>
>HTH,
>Viv

Viv,

DECLARE INTEGER CloseHandle IN Win32API INTEGER hObject
nporthandle = form1.olecontrol1.commid
nerr = closehandle(nporthandle)

will close the port and drop the handle. And the control will not like it one bit :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform