Advertisement
Advertisement
| 06.25.2008 at 08:30AM PDT, ID: 23514897 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: |
// Call of the thread
//--------------------
CMyThread * MyThread = new CMyThread();
MyThread ->CreateThread(CREATE_SUSPENDED);
MyThread ->m_Parameter = Parameter;
MyThread ->m_pDialog = pDialog;
MyThread ->ResumeThread();
// MyThread.cpp - class CMyThread : public CWinThread
//--------------
int MyThread::Run()
{
//pDialog initialized to NULL in the constructor of CMyWnd class
CMyDialog* pDialog = new CMyDialog();
//Check if new succeeded and we got a valid pointer to a dialog object
if(pDialog != NULL)
{
BOOL ret = pDialog->Create(IDD_MYDIALOG,NULL); // <- In the debugger it stops here
if(!ret) //Create failed.
AfxMessageBox("Error creating Dialog");
pDialog->ShowWindow(SW_SHOW);
}
else
AfxMessageBox("Error Creating Dialog Object");
return 0;
}
|