Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

what is the value for IOCTL_SERIAL_GET_COMMSTATUS

Posted on 2011-03-22
5
581 Views
Last Modified: 2013-12-17
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?
0
Comment
Question by:jetbet
  • 3
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35194974
According to this file, is a macro function.
0
 

Author Comment

by:jetbet
ID: 35195496
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

0
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 35195626
0
 

Author Comment

by:jetbet
ID: 35202131
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.
0
 

Author Closing Comment

by:jetbet
ID: 35286626
Thanks for your help. It seams OK if you only use Com1
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question