Dynamically loading Kinect10.dll only when a Kinect device is detected RRS feed

  • Question

  • Hi, all,

         I have been trying to avoid loading Kinect10.dll if a Kinect is not connected to the computer. The reason for that is because such DLL is pretty big and I wanted to optimize my application to avoid loading unnecessary DLLs. I am currently doing as follows:

    if( Microsoft.Kinect.KinectSensor.KinectSensors.Count > 0 )
    				this.StarKinect();//My own kinect initialization method

    I was hoping that, in order to perform this check, my application would only require to load Microsoft.Kinect.dll, which is a small DLL. However, it actually goes on and loads Kienct10.dll (~14MB) as well.

    So, my question is. is there a way to avoid this 14MB DLL loading just to check Kinect is not there? I was thinking about HIDs, but not really sure on where to start. Any pointers will be of help.



    Monday, July 9, 2012 8:33 PM

All replies

  • For those interested on this issue, I really could not find a solution to that. What I did was to set-up an XML file with user preferences that indicated whether the application/user wanted to use Kinect (true) or not (false). Depending on that setting value I may then go through the code above and load the Kinect10.dll  or not.

    It would be nice if there were a lower level way to do this though.



    Tuesday, August 14, 2012 9:20 PM