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]