|
-
April 29th, 1999, 04:10 AM
#1
Dialog Create
I want to make modeless dialog in following method.
My project is SDI windows.
I make many dialog that has same resource.
My Source is here.
m_pSendMessageDlg = new CSendMessageDlg;
m_pSendMessageDlg->Create(IDDLG_SEND_MESSAGE);
m_pSendMessageDlg->CenterWindow();
m_pSendMessageDlg->ShowWindow(SW_SHOW);
m_pSendMessageDlg->UpdateWindow();
But this code is wrong.
Because this program is dialog resource leak.
please answer this method.
My E-Mail Address [email protected]
-
April 29th, 1999, 01:31 PM
#2
Re: Dialog Create
hi,
Add handler for PostNcDestroy and use delete this inside the handler as shown below
void CSendMessageDlg::PostNcDestroy()
{
CDialog::PostNcDestroy();
delete this;
}
i do this normally and i havent had any side effects, if u face any please post it !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|