Hi all,

I¹m having an incredibly frustrating problem, which probably means I¹m doing
something stupid.

I have a class, HIDManager, which has the following data setup:

struct HIDManager_Data
{
    Boolean                Initialised;

    #if TARGET_OS_WIN32

    LPDIRECTINPUT8        myDirectInput8Object;
    GUID*                GUIDArray; // will store the array of current GUIDs
    UInt32                NumberOfDevices;

    #endif

};

typedef HIDManager_Data* HIDManager_DataRef;


...and the class has the following constructor:

static void HIDManager_Constructor (REALobject instance)
{

    ClassData (HIDManager, instance, HIDManager_Data, me);
    me->Initialised = false;

    #if TARGET_OS_MAC

    if (RebuildDeviceList(instance) == noErr) {
        me->Initialised = true;
    }

    #elif TARGET_OS_WIN32

    // blank the GUID list
    me->GUIDArray = NULL;
    // reset the count
    me->NumberOfDevices = 0;

    // create the DirectInput object
    HRESULT osErr = DirectInput8Create(GetModuleHandle(NULL),
DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&me->myDirectInput8Object,
NULL);
    if (osErr == noErr) {
        me->Initialised = true;
        CountDevices(instance);
        RebuildDeviceList(instance);
    }

    #endif

}



What I am finding is that the ³me->NumberOfDevices = 0² line causes the
following error (for a Win32 app, built using this plugin and RB 2006r1 on
Mac OS X) when the built application quits:

Runtime Error 4: Failed Assertion
Dump.cpp: 111
Failure Condition: 0
Overwrote start of block

If I comment out this line, everything works fine without the failed
assertion.


Any idea what could be causing this?  I can manipulate the Initialised and
GUIDArray values fine.

Thanks in advance for any help!

Dave.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to