Link to home
Start Free TrialLog in
Avatar of jetbet
jetbetFlag for New Zealand

asked on

what is the value for IOCTL_SERIAL_GET_COMMSTATUS

I am trying to make a call using this value but am unable to find the number for this or the reference I would need to put in to the "using" clause so my program would know what it is.

Are these values listed anywhere?
Avatar of kaufmed
kaufmed
Flag of United States of America image

According to this file, is a macro function.
Avatar of jetbet

ASKER

Do you know how I could use the following code to clear any pending communication errors?
C# Signature:

[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Auto)]
static extern bool DeviceIoControl(IntPtr hDevice, uint dwIoControlCode,
IntPtr lpInBuffer, uint nInBufferSize,
IntPtr lpOutBuffer, uint nOutBufferSize,
out uint lpBytesReturned, IntPtr lpOverlapped);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of graye
graye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jetbet

ASKER

That looks good although when I run the code the comm port cannot be opened as (according to getlasterror) "The system cannot find the file specified".

This may be due to using a usb to serial adaptor.

I will leave this question open for another day while I try and find the solution to this, and then assign the points to you.
Avatar of jetbet

ASKER

Thanks for your help. It seams OK if you only use Com1