Is it possible to create a modalless dialog box in the worker thread.



hi guys, is it possible to create a modalless dialog box in the worker
thread, actually we have try this but we got error that is" you cannot
create object with new operator in the worker thread " but i don't know


what is the actual reason behind this. actually i am trying to create
a modalless dialog box from main dialog box and i want to perform
openGL programing on both the dialog box in such a manner so that they
do not collapse or crash each other because at one time only one
rendering device context should reside in the memory if we want to
create more then one device context then we have to create this
rendering device context in different thread so that they execute with
different path in the memory and does not create any problem. please
see code given below:-


UINT CMainDlg::Thread(LPVOID param)
{
CMainDlg *self=(CMainDlg *)param;
self->m_modallessDlg = NULL;
if(self->m_modallessDlg ==NULL)
{
self->m_modallessDlg = new
CModallessDlg(self);
---<-------<-----------self->m_modallessDlg ->Create();
// error occur in this statement
| self->m_modallessDlg ->ShowWindow(WS_VISIBLE);



| }
| else
| self->m_modallessDlg ->SetActiveWindow();
| return 0;


}|


|
|
---->BOOL CModallessDlg::Create()
{
return CDialog::Create(m_nID, m_pParent); // error
occur in
this statement
}

it creates a problem.
please tell me what should i do, should i use user interface thread to
create a modalless dialog Box or what.

.



Relevant Pages

  • can i create a modalless dialog Box in the worker thread.
    ... is it possible to create a modalless dialog box in the worker ... create object with new operator in the worker thread " but i don't know ... rendering device context should reside in the memory if we want to ... different path in the memory and does not create any problem. ...
    (microsoft.public.vc.mfc)
  • can i create a modalless dialog box in worker thread.
    ... is it possible to create a modalless dialog box in the worker ... create object with new operator in the worker thread " but i don't know ... rendering device context should reside in the memory if we want to ... different path in the memory and does not create any problem. ...
    (microsoft.public.vc.mfc)