none
INuiInstance question RRS feed

  • Question

  • I am writing a program (in WINDEV, WLangage) to access KinectUI.

    In C++, to create an instance of INuiInstance, we just have to do :

    INuiInstance* myInstance;
    MSR_NuiCreateInstanceByIndex(0, &myInstance);

    In, WLangage (WINDEV), we have to do:

    myInstance is system int
    API("MSRKINECTUI.DLL", "MSR_NuiCreateInstanceByIndex", 0, &myInstance)

     

    At this step, in C++ or WINDEV, I get myInstance successfully.

     

    But then...

     

    In C++, to call (by example) the InstanceIndex() method of INuiInstance, we just have to do :

    myInstance->InstanceIndex();

    And in WLangage (WINDEV), we have to do:

    // Method #0 -> InstanceIndex
    CallInterface(myInstance, 0)

    But there, I always get a GPF with this stack:

      EIP = 0F2AD3E0    EBP = 0018EDC0
      EAX = 0018EDD4    EBX = 00000000
      ECX = FFFFFFFF    EDX = 0F372AC8
      ESI = 0018F0C4    EDI = 0018F0E4

    [MSRKINECTNUI.DLL (0F2A0000)] 0F2AC950 : DllGetClassObject() + 2704 bytes

     

    Generally, this error (through CallInterface) tells us that :

    - the interface pointer is invalid
    - or, the method number is invalid
    - or, one or more parameters is invalid
    - or, the interface pointer does not represent a simple object, but complex object.

     

    So my question is :

    Is the pointer returned by MSR_NuiCreateInstanceByIndex a pointer to a class that only implements INuiInstance or a pointer to another thing ? Does it need special coding to call a method of this class in other language than C++/.NET ?

    When I tried to get the VTABLE from this pointer, I successfully retrieved the 15 methods pointers of the INuiInstance interface...
    I do not understand what to do at this time...

     

     

    Wednesday, July 20, 2011 3:37 PM

Answers

  • Hi,

    I found the problem and transmitted it to PC SOFT.

    CallInterface WLangage function does not support __thiscall, only __cdecl and __stdcall. 
    They assure me to give a correction for a future release.

    So for now, I will only rely on basic functions offered by MSRKINECTUI.

    Thanks again

    • Marked as answer by ThunderGuy Tuesday, July 26, 2011 9:19 AM
    Tuesday, July 26, 2011 9:19 AM

All replies

  • Hi,

    No response :(

    Could someone in Kinect SDK team answer me ?

     

    Thanks

    Friday, July 22, 2011 1:13 PM
  • We are not testing on WLanguage, since it is not one of our supported languages, so the best we can do is answer your questions literally, without any guarantee that anything we say will make things work for you in wlanguage.

    The pointer returned by MSR_NuiCreateInstanceByIndex is a pointer to a class that implements INuiInstance and may also extend other classes and implement other interfaces. It is also not a COM pointer, so it doesn't have the COM gurantee of cross-language binary compatibility and, as such, may not work for languages other than C++. Only guarantee for returned pointer is that it will support INuiInstance C++ interface.

    About your other question of: Does it need special coding to call a method of this class in other language than C++/.NET ?

    Probably so, but we haven't tested that scenario, so you would have to go through the effort of finding out.

    Sorry we can't help you more.
    Eddy


    I'm here to help
    Friday, July 22, 2011 8:26 PM
  • Hi Eddy,

    Thanks for your reply. I would be proud to achieve a satisfactory result... now I have more information!

    WLangage function CallInterface does not need necessary a COM pointer, a C++ object should work too.

    The way to work with this depends on what the pointer is.

    So I'll keep trying, and I would keep the community informed (for those who also develop in WLanguage).

     

    Thanks again

     

    Friday, July 22, 2011 10:04 PM
  • Hi,

    I found the problem and transmitted it to PC SOFT.

    CallInterface WLangage function does not support __thiscall, only __cdecl and __stdcall. 
    They assure me to give a correction for a future release.

    So for now, I will only rely on basic functions offered by MSRKINECTUI.

    Thanks again

    • Marked as answer by ThunderGuy Tuesday, July 26, 2011 9:19 AM
    Tuesday, July 26, 2011 9:19 AM
  • Thanks for sharing, ThunderGuy. Good to know.

    Eddy


    I'm here to help
    Tuesday, July 26, 2011 9:49 AM