F
Fla
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.aspx?scid=kb;en-us;823179&Product=vb6
I tried with ReadFile with the following code lines:
Try
Success = ReadFile(hSerialPort, Buffer, BytesWritten,
BytesRead, IntPtr.Zero)
If Success = False 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").
Is it better DeviceIoControl? What am I doing wrong?
Thanks for your replies.
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.aspx?scid=kb;en-us;823179&Product=vb6
I tried with ReadFile with the following code lines:
Try
Success = ReadFile(hSerialPort, Buffer, BytesWritten,
BytesRead, IntPtr.Zero)
If Success = False 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").
Is it better DeviceIoControl? What am I doing wrong?
Thanks for your replies.