Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Programming
author message
usb application
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
raunaque
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 12 Aug, 2004
1. usb application
Reply to this topic with quote Modify your message
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 ;
}

Date: 12 Aug, 2004 on 11:15
raunaque
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 12 Aug, 2004
2. Re:usb application
Reply to this topic with quote Modify your message
i have some
Date: 12 Aug, 2004 on 14:08
Martin
Team member
in admin

View this member's profileSearch all posts from this memberSend an email to this memberhttp://www.os2world.com/
posts: 535
since: 10 Dec, 2000
3. Re:usb application
Reply to this topic with quote Modify your message
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

Date: 14 Aug, 2004 on 17:44
BigWarpGuy
Premium member
in staff

View this member's profileSearch all posts from this memberSend an email to this memberhttp://home.comcast.net/~tomleem
posts: 2298
since: 12 Jan, 2001
4. Re:usb application
Reply to this topic with quote Modify your message
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.
- - - - - - - - - - - - - - - - -
Date: 15 Aug, 2004 on 22:26
usb application
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com 2000-2004