title: Kinect SDK 2.0 handle and acquire depth frame
body: <p>I am actually working with the Kinect V2 (the one for Xbox One) and I am trying to have a depth stream. I want to see what the depth sensor of Kinect sees. But I don't succeed to open a stream. I only succeed to open a single frame with another piece of code, but not a video. With a few research, I have tried to use handles, but the code I wrote don't printe on the screen the line 'stream' put at the end of the code. I am working on VS2012, the code is in C++.</p>
  
  <p>I think I have this because I don't know how to use correcty an handle... If anybody could help me and explain to me what an handle is instead of a kind of pointer to something, it would be great. Thank you</p>
  
  <p>Here is my code : </p>
  
  <p><code>HRESULT hr=S_OK;
      WAITABLE_HANDLE *stream=nullptr;
      IKinectSensor* kinectSensor=nullptr;</code></p>
  
  <pre><code>if( SUCCEEDED(hr) )
  {
      std::cout &lt;&lt; "Success IKinectSensor::GetDefaultSensor" &lt;&lt; std::endl;
  }
  
  else
  {
      std::cout &lt;&lt; "Failed IKinectSensor::GetDefaultSensor" &lt;&lt; std::endl;
  }
  
  std::cout &lt;&lt; "Opening sensors" &lt;&lt; std::endl;
  if(kinectSensor != NULL)
  {
      hr = kinectSensor-&gt;Open();
  
      Sleep(sleeptime*5);
      if( SUCCEEDED( hr ) )
      {
          std::cout &lt;&lt; "Success IKinectSensor::Open" &lt;&lt; std::endl;
      }
  
      else
      {
          std::cout &lt;&lt; "Failed IKinectSensor::Open" &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>hr = kinectSensor-&gt;OpenMultiSourceFrameReader(FrameSourceTypes_Depth | FrameSourceTypes_Color , &amp;multiSourceReader);
  if( SUCCEEDED(hr) )
  {
      std::cout &lt;&lt; "reader open" &lt;&lt; std::endl;
  
      hr = multiSourceReader-&gt;SubscribeMultiSourceFrameArrived(stream);
      if( SUCCEEDED(hr) )
      {
          std::cout &lt;&lt; "stream" &lt;&lt; std::endl;
      }
  } 
  </code></pre>