I have created a new thread - that works perfect. Now I want to display a CDialog in this thread. In a Thread Montor a new thread with the name of the dialog is shown but i can not see the dialog. I have called the dialog without a thread - that worked. That have I done wrong?
Below some code which may help.
// Call of the thread
CMyThread * MyThread = new CMyThread();
MyThread ->m_Parameter = Parameter;
MyThread ->m_pDialog = pDialog;
// MyThread.cpp - class CMyThread : public CWinThread
//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");
AfxMessageBox("Error Creating Dialog Object");