المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : UINT ThreadProc ( LPVOID param )



C++ Programming
08-03-2009, 03:22 PM
Hello,

i tried it the way you said, but it did not work , maybe i did something wrong, hier is the code:

void CTestView::ThreadStart(CTestDoc* pDoc, CString strSel)
{
m_Thread_Sel_Start.SetEvent ();

HWND hWnd = GetSafeHwnd();

m_strSelect = strSel;

m_pDoc = pDoc;// i need to access the CTestDoc.cpp, i passed pDoc from the CTestDoc.cpp to the CTestView.cpp
// and then assigend pDoc to m_pDoc which defined in the top of the CTestView.cpp

AfxBeginThread(ThreadProc, this/*hWnd*/, THREAD_PRIORITY_NORMAL);// Hier i passed this to the ThreadProc function
}

UINT ThreadProc
(
LPVOID param
)
{

(CTestView*)param-> // casting to CTestView did not work?

return 0;
}