/// <summary> /// Entry point for the application /// </summary> /// <param name="hInstance">handle to the application instance</param> /// <param name="hPrevInstance">always 0</param> /// <param name="lpCmdLine">command line arguments</param> /// <param name="nCmdShow">whether to display minimized, maximized, or normally</param> /// <returns>status</returns> int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); CBodyBasics application; application.Run(hInstance, nCmdShow); }
/// <summary> /// Entry point for the application /// </summary> /// <param name="hInstance">handle to the application instance</param> /// <param name="hPrevInstance">always 0</param> /// <param name="lpCmdLine">command line arguments</param> /// <param name="nCmdShow">whether to display minimized, maximized, or normally</param> /// <returns>status</returns> int APIENTRY wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nShowCmd ) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); CBodyBasics application; application.Run(hInstance, nShowCmd); }
int main() { CBodyBasics myKinect; HRESULT hr = myKinect.InitializeDefaultSensor(); if (SUCCEEDED(hr)) { while (1) { myKinect.Update(); } } else { cout << "kinect initialization failed!" << endl; system("pause"); } }
/// <summary> /// Handles window messages, passes most to the class instance to handle /// </summary> /// <param name="hWnd">window message is for</param> /// <param name="uMsg">message</param> /// <param name="wParam">message data</param> /// <param name="lParam">additional message data</param> /// <returns>result of message processing</returns> LRESULT CALLBACK CBodyBasics::MessageRouter(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { CBodyBasics* pThis = NULL; if (WM_INITDIALOG == uMsg) { pThis = reinterpret_cast<CBodyBasics*>(lParam); SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pThis)); } else { pThis = reinterpret_cast<CBodyBasics*>(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); } if (pThis) { return pThis->DlgProc(hWnd, uMsg, wParam, lParam); } return 0; }