Im new to this group and i have a problem and i hope that someone can
give me a few insights.

I have an OpenGL Window, derived from CWnd. Now, there is a function
called Plot, which creates this window and displays it. What i would
like to do is run this function when the VC++ debugger is running from
the Watch window. So in the watch window, if i type plot(), it should
open the window. I tried opening a modal dialog box, but what is
happening is , if the modal dialog is inactive for a while, focus is
returned to the Debugger thread and plot() is called again, which sort
of freezes the dialog.

Any suggestions



void plot()
IDSPlottingWnd* m_pDisplay = new IDSPlottingWnd;
CString className = AfxRegisterWndClass(NULL);

int ret = m_pDisplay->CreateEx(WS_EX_CLIENTEDGE,
className, //Registered Window Class
"Plot Figure Window",
WS_OVERLAPPEDWINDOW, CRect(10,10,500,500),
if (ret != 0)