raj.3one
Newbie level 1
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 **broken link removed**.
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
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 **broken link removed**.
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