Is it possible to create a modalless dialog box in the worker thread.
- From: raghunandan_1081@xxxxxxxxx
- Date: 30 Mar 2006 20:36:26 -0800
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.
.
- Follow-Ups:
- Prev by Date: Re: Questions
- Next by Date: Re: Questions
- Previous by thread: Questions
- Next by thread: Re: Is it possible to create a modalless dialog box in the worker thread.
- Index(es):
Relevant Pages
|