gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > F2A USB Linker

#9762 - Vertex - Sat Aug 16, 2003 5:23 pm

Hi!
How i can communicate with the USB-Interface?
I use the following code to open the USB-Port:
Code:

hDevice = CreateFile("\\.\ezusb-0",GENERIC_WRITE Or GENERIC_READ,FILE_SHARE_WRITE Or FILE_SHARE_READ,0,OPEN_EXISTING,0,0)

If the linker connected to pc then hDevice are a number
unequally -1, thus is ok. But why i can't use DeviceIoControl
function?
Control = DeviceIoControl(hDriver,4,&lIn, 4,&lOut,4,&lSize,&gOverlapped);
Control is always = 0 :(
Can You help me?
cu olli
P.S. Sorry for my bad English i come from Germany :)