none
Unique Device Name C++ RRS feed

All replies

  • You can use code like:

    BSTR Name = NULL;
    MSR_NuiGetPropsBlob( MsrNui::INDEX_UNIQUE_DEVICE_NAME, (void*) &Name, NULL );
    ...
    // Use Name
    ...
    SysFreeString( Name );

    Eddy


    I'm here to help
    Friday, October 21, 2011 2:52 AM
  • I'm getting the name as FAKE KINECT SHIM. That can't be correct. I expected something like

      USB\VID_0409&PID_005A\6&1F9D61BF&0&4

    I must be forgetting something. I'm using the Aug 2 code.

    Michael

     

    Sunday, October 23, 2011 8:33 PM
  • Hmm, do you have kinect device plugged in and properly initialized by application? I was trying to give you the minimal code to get this functional, but a slightly larger code snippet that should work even when multiple kinect devices (error handling code omitted) are present is:

     

    INuiInstance *pNuiInstance = NULL;
    BSTR Name = NULL;
    
    MSR_NuiCreateInstanceByIndex(0, &pNuiInstance);
    pNuiInstance->NuiInitialize(NUI_INITIALIZE_FLAG_USES_COLOR); // Add whatever initialization flags you need here
    pNuiInstance->MSR_NuiGetPropsBlob( MsrNui::INDEX_UNIQUE_DEVICE_NAME, (void*) &Name, NULL );
    ...
    // Use Name
    ...
    SysFreeString( Name );
    MSR_NuiDestroyInstance(pNuiInstance);

    Eddy

     


    I'm here to help
    Monday, October 24, 2011 9:47 PM
  • I thought I had it properly initialized. I've based my code on the Skeletal Viewer. I'm using only one Kinect.

    When I try your code I get this error:

    c:\projectwordsign\wordsignkinect\nuiimpl.cpp(78): error C2259: 'INuiInstance' : cannot instantiate abstract class

    thanks for your help.

     

    Michael

    Monday, October 24, 2011 11:34 PM
  • The line that I had written above which read

    INuiInstance pNuiInstance = NULL;

    should be

    INuiInstance *pNuiInstance = NULL;

    it was a typo, sorry. I've also fixed it in sample.
    Eddy


    I'm here to help
    Tuesday, November 1, 2011 3:30 AM