N
Nate Kohari
Hello all,
I am developing an application in C# with a target platform of Windows
CE 4.2, and I need to make a call to DeviceIoControl() to control the
hardware of our target device. I'm using OpenNETCF (which is a
fantastic library by the way!), but whenever I use the
FileEx.CreateFile() wrapper to get a handle for the device, it throws
an error with the Win32 error code 55 (device not found).
I have an example (written in C++) from the device manufacturer of how
to manipulate the device, and basically I'm trying to port it to
managed code so I don't have to have a separate library. I'm certain
that I'm calling it with the correct device name, and the equivalent
access, share, and disposition parameters as their example shows.
Here is the line that throws the exception:
handle = FileEx.CreateFile(@"TGR1:",
FileAccess.Read | FileAccess.Write,
FileShare.ReadWrite,
FileCreateDisposition.OpenExisting,
0);
I'm by no means an expert when it comes to the Win32 API... does
something jump out at anyone? I can also create a secondary library in
C++ using the information the manufacturer provided me with and
P/Invoke functions in it, but if I can handle all of this in managed
code I'd much prefer to do so.
Thanks,
Nate Kohari
I am developing an application in C# with a target platform of Windows
CE 4.2, and I need to make a call to DeviceIoControl() to control the
hardware of our target device. I'm using OpenNETCF (which is a
fantastic library by the way!), but whenever I use the
FileEx.CreateFile() wrapper to get a handle for the device, it throws
an error with the Win32 error code 55 (device not found).
I have an example (written in C++) from the device manufacturer of how
to manipulate the device, and basically I'm trying to port it to
managed code so I don't have to have a separate library. I'm certain
that I'm calling it with the correct device name, and the equivalent
access, share, and disposition parameters as their example shows.
Here is the line that throws the exception:
handle = FileEx.CreateFile(@"TGR1:",
FileAccess.Read | FileAccess.Write,
FileShare.ReadWrite,
FileCreateDisposition.OpenExisting,
0);
I'm by no means an expert when it comes to the Win32 API... does
something jump out at anyone? I can also create a secondary library in
C++ using the information the manufacturer provided me with and
P/Invoke functions in it, but if I can handle all of this in managed
code I'd much prefer to do so.
Thanks,
Nate Kohari