Hy!
I'm newbie to VB 2005 and I'm trying to read value from a device
driver, as I used in VB6 with CreateFile and DeveiceIoControl. I get a
correct driver handle with CreateFile but I can't read values with
ReadFile, as reported in this URL
http://support.microsoft.com/default...79&Product=vb6
I tried with ReadFile with the following code lines:
Try
Success = ReadFile(hSerialPort, Buffer, BytesWritten,
BytesRead, IntPtr.Zero)
MessageBox.Show("Last Win32 Error" & vbCrLf &
CStr(System.Runtime.InteropServices.Marshal.GetLas tWin32Error()))
If Result = 0 Then
Throw New CommException("Unable to read from driver")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
End Try
but I couldn't get values from device driver 'cause I get an exception
("Unable to read from driver") and I get value 6 from
GetLastWin32Error.
What does it me 6 for GetLastWin32Error? What am I doing wrong?
Thanks for your replies.