473,395 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Device Driver VB 2005 [2]

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...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.

Feb 8 '06 #1
0 1146

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Wouter van Ooijen | last post by:
I want to use Python to interface with an USB HID device (not a keyboard or mouse, just something that uses the HID driver to avoid the need for a specific driver). Is this possible in pure Python...
2
by: nbhalala | last post by:
Hello Friends, Hi Myself Naresh (B.E. Comp. Eng) from Mumbai... I'm a Linux Device Driver Writer... I would like to learn writing Driver of "USB Devices"...BUT before that I'm presently working...
12
by: Steve | last post by:
I wrote a simple virtual device driver int15.sys, Is C# support load the device driver from AP?
8
by: Tony Liu | last post by:
I am having a "Null Device is Missing" compile error when compiling a c++ project. The documentation from MSDN said it could be caused by low system resource or the user account does not have...
3
by: bb | last post by:
I have a windows network device driver written in c++ and a user interface im porting to c#, my problem is i dont seem to be getting notified of the event calls from the driver to the c# app im...
7
by: Ritu | last post by:
Hi All, Can any body please tell me how i can write a device driver using CSharp. Thanks, Ritu
0
by: am | last post by:
Hi, I have an USB hardware device that came with some (poor) software. I would like to write my own software to use the hardware in dotnet. There are no COM dll's to reference from the...
6
by: Fla | last post by:
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...
1
by: =?Utf-8?B?15DXldeo158=?= | last post by:
I have recently installed my windows XP, the process went smoothly, but I had encounterd some drivers issues after the installation. I managed to solve the ethernet adapter driver issue, but I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.