I want to use communication module and show graphic surface in the same time(like a using more one thread).
Thank you.
Thank you.
A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.
// Note: If your compiler cannot find "_beginthreadex" you are probably using the single-threaded
// version of the run-time library. Change this in your project settings to "Multithreaded".
// (Hint: "Project" -> "Settings" -> "C/C++" -> "Code Generation" -> "Use run-time library")
#ifdef _WIN32_WCE
DWORD dwThreadID;
m_hThread = ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) CMyClass::StaticFunction, (void*)this, CREATE_SUSPENDED, &dwThreadID);
#else
unsigned int nThreadID;
m_hThread = (void*) ::_beginthreadex(NULL, 0, &CMyClass::StaticFunction, (void*)this, CREATE_SUSPENDED, &nThreadID);
#endif
if (NULL == m_hThread)
{
SetError(TEXT("Could not create primary thread."), ::GetLastError());
CloseDisplay();
DestroyMainWindow();
return E_FAIL;
}
// Start thread
::ResumeThread(m_hThread);
Do I have to create a CMyClass object like a CMyApplication?
What're necessary things in CMyClass::StaticFunction()?