Win32 Application settings

Post Reply
Dronas
Posts: 7
Joined: Sun Apr 20, 2008 3:47 am

Win32 Application settings

Post by Dronas »

Which OptiTrack SDK project settings requared for running application on all PC?

My application work on my system, but can't start on other

error:
Image

or:
Image
from other application, crashed when i call cameraCollection->enum after cameraCollection.CoCreateInstance(CLSID_NPCameraCollection) but cameraCollection == NULL

All system has TrackIR3Pro or TrackIR4 installed

Optitrack_GrayscaleSample_v3 work only my system too!!!

Code: Select all

#include <windows.h>
#include <optitrack.h>
#include <atlbase.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	HRESULT hr;
	CComPtr<INPCameraCollection> cameraCollection;

	CoInitialize(NULL);
	hr = CoCreateInstance(__uuidof(NPCameraCollection), NULL, CLSCTX_ALL,
		__uuidof(INPCameraCollection), (void **) &cameraCollection);
	//hr = cameraCollection.CoCreateInstance(CLSID_NPCameraCollection);
	switch (hr)
	{
	case S_OK:
		MessageBox(NULL, L"S_OK", L"CoCreateInstance result", 0);
		break;
	case E_ABORT:
		MessageBox(NULL, L"E_ABORT", L"CoCreateInstance result", 0);
		break;
	case E_ACCESSDENIED:
		MessageBox(NULL, L"E_ACCESSDENIED", L"CoCreateInstance result", 0);
		break;
	case E_FAIL:
		MessageBox(NULL, L"E_FAIL", L"CoCreateInstance result", 0);
		break;
	case E_HANDLE:
		MessageBox(NULL, L"E_HANDLE", L"CoCreateInstance result", 0);
		break;
	case E_INVALIDARG:
		MessageBox(NULL, L"E_INVALIDARG", L"CoCreateInstance result", 0);
		break;
	case E_NOINTERFACE:
		MessageBox(NULL, L"E_NOINTERFACE", L"CoCreateInstance result", 0);
		break;
	case E_NOTIMPL:
		MessageBox(NULL, L"E_NOTIMPL", L"CoCreateInstance result", 0);
		break;
	case E_OUTOFMEMORY:
		MessageBox(NULL, L"E_OUTOFMEMORY", L"CoCreateInstance result", 0);
		break;
	case E_POINTER:
		MessageBox(NULL, L"E_POINTER", L"CoCreateInstance result", 0);
		break;
	case E_UNEXPECTED:
		MessageBox(NULL, L"E_UNEXPECTED", L"CoCreateInstance result", 0);
		break;
	default:
		MessageBox(NULL, L"Default", L"CoCreateInstance result", 0);
		break;
	}
	cameraCollection.Release();
	CoUninitialize();
	return 0;
}
return Default!
Dronas
Posts: 7
Joined: Sun Apr 20, 2008 3:47 am

Re: Win32 Application settings

Post by Dronas »

Rename on my system NaturalPoint\Optitrack\bin folder and receipt result similar other systems.
icanflysohigh
Posts: 7
Joined: Sun Apr 06, 2008 6:33 pm

Re: Win32 Application settings

Post by icanflysohigh »

I found Enum sometimes hangs using the 1.1.034 SDK with TIR4 on XP.
Post Reply