Hi,

I have created a dialog which I want to open from OnCommand event of an
menu item.
If the dialog is already open , this command should not open the dialog
(CPallette),
I open the dialog from the menu item (pls. refer following code). Now
if I close this dialog and again try to open it by clicking the menu
item, it does not open any dialog instance, why is that so. Please give
some solution.

Code is as follows.

I put in
class CMainFrame : public CMDIFrameWnd
{
Public:
CPallette *mypal;
..
..
}

void CMainFrame::OnToolsOpenpalette()
{
// TODO: Add your command handler code here
if(!::IsWindow(mypal->GetSafeHwnd()))
{
mypal = new CPallette;
mypal->Create(IDD_DIALOG1, this);
mypal->ShowWindow(SW_SHOW);
}

Thanks,
Cric.