EDN Admin
Well-known member
Hi guys,
I have download a project from Kinect documents.
When I open the sln file of the project, the solution explorer shows as following:
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/120534
And the "Resource View" shows as following:
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/120535
The entry point of the project is :
<pre class="prettyprint int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)[/code]
Some of the code clip is like:
<pre class="prettyprint int CSkeletonBasics::Run(HINSTANCE hInstance, int nCmdShow)
{
MSG msg = {0};
WNDCLASS wc = {0};
// Dialog custom window class
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = hInstance;
wc.hCursor = LoadCursorW(NULL, IDC_ARROW);
wc.hIcon = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_APP));
wc.lpfnWndProc = DefDlgProcW;
wc.lpszClassName = L"SkeletonBasicsAppDlgWndClass";
if (!RegisterClassW(&wc))
{
return 0;
}
// Create main application window
HWND hWndApp = CreateDialogParamW(
hInstance,
MAKEINTRESOURCE(IDD_APP),
NULL,
(DLGPROC)CSkeletonBasics::MessageRouter,
reinterpret_cast<LPARAM>(this));
// Show window
ShowWindow(hWndApp, nCmdShow);
const int eventCount = 1;
HANDLE hEvents[eventCount];
// Main message loop
while (WM_QUIT != msg.message)
{
hEvents[0] = m_hNextSkeletonEvent;
// Check to see if we have either a message (by passing in QS_ALLEVENTS)
// Or a Kinect event (hEvents)
// Update() will check for Kinect events individually, in case more than one are signalled
DWORD dwEvent = MsgWaitForMultipleObjects(eventCount, hEvents, FALSE, INFINITE, QS_ALLINPUT);
// Check if this is an event were waiting on and not a timeout or message
if (WAIT_OBJECT_0 == dwEvent)
{
Update();
}
if (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
{
// If a dialog message will be taken care of by the dialog proc
if ((hWndApp != NULL) && IsDialogMessageW(hWndApp, &msg))
{
continue;
}
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
}
return static_cast<int>(msg.wParam);
}<br/>[/code]
My question is like this:
How can I create a project like this?
I have tried to create all kinds of Visual C++, like CLR, Win32, MFC and General.
But none of them create a project like the downloading one.
Thanks,
<span style="font-size:large <span style="font-size:large
View the full article
I have download a project from Kinect documents.
When I open the sln file of the project, the solution explorer shows as following:
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/120534
And the "Resource View" shows as following:
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/120535
The entry point of the project is :
<pre class="prettyprint int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)[/code]
Some of the code clip is like:
<pre class="prettyprint int CSkeletonBasics::Run(HINSTANCE hInstance, int nCmdShow)
{
MSG msg = {0};
WNDCLASS wc = {0};
// Dialog custom window class
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = hInstance;
wc.hCursor = LoadCursorW(NULL, IDC_ARROW);
wc.hIcon = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_APP));
wc.lpfnWndProc = DefDlgProcW;
wc.lpszClassName = L"SkeletonBasicsAppDlgWndClass";
if (!RegisterClassW(&wc))
{
return 0;
}
// Create main application window
HWND hWndApp = CreateDialogParamW(
hInstance,
MAKEINTRESOURCE(IDD_APP),
NULL,
(DLGPROC)CSkeletonBasics::MessageRouter,
reinterpret_cast<LPARAM>(this));
// Show window
ShowWindow(hWndApp, nCmdShow);
const int eventCount = 1;
HANDLE hEvents[eventCount];
// Main message loop
while (WM_QUIT != msg.message)
{
hEvents[0] = m_hNextSkeletonEvent;
// Check to see if we have either a message (by passing in QS_ALLEVENTS)
// Or a Kinect event (hEvents)
// Update() will check for Kinect events individually, in case more than one are signalled
DWORD dwEvent = MsgWaitForMultipleObjects(eventCount, hEvents, FALSE, INFINITE, QS_ALLINPUT);
// Check if this is an event were waiting on and not a timeout or message
if (WAIT_OBJECT_0 == dwEvent)
{
Update();
}
if (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
{
// If a dialog message will be taken care of by the dialog proc
if ((hWndApp != NULL) && IsDialogMessageW(hWndApp, &msg))
{
continue;
}
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
}
return static_cast<int>(msg.wParam);
}<br/>[/code]
My question is like this:
How can I create a project like this?
I have tried to create all kinds of Visual C++, like CLR, Win32, MFC and General.
But none of them create a project like the downloading one.
Thanks,
<span style="font-size:large <span style="font-size:large
View the full article