Sign in to follow this  

EnumObjects generates unahled exception

This topic is 2051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm doing some discovery on my stick (X-52) and I'm getting an unhandled exception when I attempt to enumerate the objects on it. The drivers are the MS installed ones (as soon as I plug in my stick it installs them). I can't at this time install the Saitek drivers over it, so I'm stuck here now.

The callback prototype:

[CODE]BOOL CALLBACK ObjectCallback( LPCDIDEVICEOBJECTINSTANCE, VOID*);[/CODE]

The call:

[CODE] if( FAILED(hr = joystick->EnumObjects( ObjectCallback, NULL, DIDFT_ALL )))
return hr;[/CODE]

The callback function:

[CODE]BOOL CALLBACK ObjectCallback( LPCDIDEVICEOBJECTINSTANCE ObjectInstance, VOID *context)
{

JSControlData *jscinstance = new JSControlData;

memcpy( jscinstance, ObjectInstance, sizeof( JSControlData ));

jsdata.jscdata.push_back(jscinstance);

// keep going until we get them all.
return DIENUM_CONTINUE;
}[/CODE]

The error:
Unhandled exception at 0x01342e73 in jsfind.exe: 0xC0000005: Access violation reading location 0xccccccd0.

It's happening in xutility, in the _Adopt function of the _Iterator_base12 structure. The parent is going in NULL, but I can't determine why.

If I build in release, it will get one object, then stop responding. And, yes, DI and the stick get created with no errors and I can get the capabilities as well, but I can't get info on each object.

Does anyone have any insight on this problem?

PS: Make that "unhandled" exception. I can't go back and edit the title. Edited by jfalstaff

Share this post


Link to post
Share on other sites
Solved. For some reason, STL is choking it. I'll look into this more, but I'll have to use straight C for this quick implementation. Edited by jfalstaff

Share this post


Link to post
Share on other sites

This topic is 2051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this