OS2 World.Com Forum

Subject  :  usb application
Author  :  raunaque raunaque.quaiser@st.com
Date  :  12 Aug, 2004 on 11:15
Hello ,
i am write a usb application in which my application will communicate with the USB device.the problem is that i am unable to execute successfully the CreateFile() function .
i am attaching the piece of code , Can i open .sys file ir which file i have to open to acess the uSB device
#include <iostream.h>
#include <windows.h>
#include <winioctl.h>
#include <stdio.h>

void main(void )
{
HANDLE htest;
char write_hex_data =0x003;
char written_hex_data =0x004;
unsigned long k=20;
int write;
//htest=CreateFile("\\\\.\\usbport.sys",GENERIC_WRITE|GENERIC_READ ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_READONLY,NULL);
htest=CreateFile("C:\WINNT\system32\drivers\usbhub.sys",GENERIC_READ | GENERIC_WRITE ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_READONLY,NULL);


write =GetLastError();
cout<<write <<endl;

cout<<htest<<endl;
write=WriteFile(htest,&write_hex_data,10,&k,NULL);
cout<<write<<endl;
return ;
}


Subject  :  Re:usb application
Author  :  raunaque raunaque.quaiser@st.com
Date  :  12 Aug, 2004 on 14:08
i have some

Subject  :  Re:usb application
Author  :  Martin
Date  :  14 Aug, 2004 on 17:44
Hi

This is an OS/2 forum. Are you writting this app for Windows or OS/2 If it for Windows you won't get help on this forum.

Regards


Subject  :  Re:usb application
Author  :  BigWarpGuy
Date  :  15 Aug, 2004 on 22:26
It would be interesting what USB device his program is trying to communicate with(?)

---
BigWarpGuy
- - - - - - - - - - - - - - - - - -
OS/2 Warp-ed/eComStation-ed to the very end.
- - - - - - - - - - - - - - - - -

Powered by UltraBoard 2000 <www.ub2k.com>