Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

WriteFile() is not working. giving 1784

Status
Not open for further replies.

raj.3one

Newbie level 1
Joined
Jan 9, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
HI..Good day Every One..

I am developing a Windows application to communicate with a <b> USB HID for target board MCB1700</b> in visual c++ 6.0.
here i'm able to get vendor id, product id, version number. But i'm not able to execute the writefile function. I'm trying to write 64 bytes of data. for that it is giving 1784 as getlast error.

my code is
<pre>
HIDHandle = CreateFile(FunctionClassDeviceData.DevicePath,GENERIC_WRITE|GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE, &SecurityAttributes, OPEN_EXISTING, 0, NULL);
. //code to get HIDAttributes
.
//here the issue code
int retval = 0;
DWORD BytesWritten;
BYTE OutReport[64] = {0x00};
retval = WriteFile(HIDHandle, OutReport, sizeof(OutReport), (LPDWORD)&BytesWritten, NULL);
printf("return Value: %d\n", retval); // returning 0 value
retval = GetLastError();
printf("Last error Value: %d\n", retval); //it is 1784.
</pre>

And same hardware is working fine with generic_hid_cs_50 http://www.lvr.com/files/generic_hid_cs_50.zip.
For target side details please go refer below link
Problem when EP1 is used for OUT EP in RTX HID program


Anybody has any suggestion of what I should do? Thanks.
Thanks & Regards,
Raja Kumar
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top