I'm using this simple (too simple ?) C++ code, but something goes wrong.
The error seems to come from get_IsEmpty call.
I'm using VS2008 and it seems that the frame returned by GetFrame is null (actually the p field from the COM object is null).
What did I do wrong ?
I went to watch the minimal C++ code, but doesn't help.
I thought this might come from not using FrameAvailableEvent, but events arenn't used in the Grayscale Example and it works fine...
Thx for help
Code: Select all
CComPtr<INPCameraCollection> collection;
CComPtr<INPCamera> camera;
CComPtr<INPCameraFrame> frame;
CoInitialize(NULL);
collection.CoCreateInstance(CLSID_NPCameraCollection) ;
collection->Enum() ;
collection->Item(0, &camera) ;
camera->Open() ;
camera->Start() ;
camera->GetFrame(0, &frame);
VARIANT_BOOL t;
// Error here
frame->get_IsEmpty( &t );
camera->Stop();
camera->Close();
camera.Release();
collection.Release();
CoUninitialize();