>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only