This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

WriteFile() is not working. giving 1784

HI..Good day Every One..

I am developing a Windows application to communicate with a USB HID for target board MCB1700 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

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.

And same hardware is working fine with generic_hid_cs_50 www.lvr.com/.../generic_hid_cs_50.zip.
For target side details please go refer below link
http://www.keil.com/forum/20085/

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

0