electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

GetLastError() error code 1784


Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing -> GetLastError() error code 1784
Author Message
yawijaya



Joined: 18 Aug 2009
Posts: 29
Location: New Freedom, PA-USA


Post29 Oct 2009 18:19   

GetLastError() error code 1784


I am developing a Windows application to communicate with a USB HID. I've got the firmware working on the device, and windows also recognize it without problem. I am now stumbled on how my software will be able to find the correct device to communicate with. I've read several codes online and pretty much they all refer to the same method of finding the correct device. However, there seems to be a part on the code that is giving me trouble, which is the calling of SetupDiGetDeviceInterfaceDetail function. Here's the piece of the code:

HidD_GetHidGuid(&HidGuid);

hDevInfo=SetupDiGetClassDevs
(&HidGuid,
NULL,
NULL,
DIGCF_PRESENT | DIGCF_INTERFACEDEVICE);


devInfoData.cbSize=sizeof(devInfoData);
LastDevice=FALSE;

Result=SetupDiEnumDeviceInterfaces
(hDevInfo,
0,
&HidGuid,
MemberIndex,
&devInfoData);

if(Result != 0)
{
Result=SetupDiGetDeviceInterfaceDetail
(hDevInfo,
&devInfoData,
NULL,
0,
&Length,
NULL);


detailData=(PSP_DEVICE_INTERFACE_DETAIL_DATA)malloc(Length);


detailData->cbSize=sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
Memo->Text= detailData->cbSize;



Result=SetupDiGetDeviceInterfaceDetail
(hDevInfo,
&devInfoData,
detailData,
Length,
&Required,
NULL);

Result=GetLastError();
Memo->Lines->Add(Result);
}

The GetLastError() would return error code 1784, which is "The supplied user buffer is not valid for the requested operation." Is this error expected? If not, anybody has any suggestion of what I should do?Thanks
Back to top
Google
AdSense
Google Adsense




Post29 Oct 2009 18:19   

Ads




Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing -> GetLastError() error code 1784
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
about RS code decoder - error only and error and erasure (1)
Error in code (2)
Error in Verilog code (4)
C18 code error?? (1)
Hamming code 8,4 error correction (5)
MAX6675 interfacing code error (5)
Error Correction Code (ECC) (2)
Racal 9087 error code 82 (1)
error in elevator code (vhdl) (11)
error in dtft code of matlab (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS