I’m having problems trying to draw simple graphics (using the CDC::Ellipse function) in my SDI application. My program consists of the following classes :
class CMainFrame : public CframeWnd
class CChildView : public CWnd
class CVDANApp : public CWinApp
I also have a menu resource. I need a circle to be drawn in the ChildView window when the user clicks on a specific item (called “Run”) in the menu resource, as shown in the following code:
void CVDANApp::OnRun()
{
CWnd* pThisWnd = CChildView::GetActiveWindow();
drawmycircle(pThisWnd);
}
My problem is that I don’t know how to define a CWnd pointer to the CChildView class so that I can create a CPaintDC device context in the global drawmycircle function. I think my problem is that the GetActiveWindow() function points to the CMainFrame class instead of the CChildView class. How do I make it point to the child frame?
Any hints would be extremely helpful. Thanks…
class CMainFrame : public CframeWnd
class CChildView : public CWnd
class CVDANApp : public CWinApp
I also have a menu resource. I need a circle to be drawn in the ChildView window when the user clicks on a specific item (called “Run”) in the menu resource, as shown in the following code:
void CVDANApp::OnRun()
{
CWnd* pThisWnd = CChildView::GetActiveWindow();
drawmycircle(pThisWnd);
}
My problem is that I don’t know how to define a CWnd pointer to the CChildView class so that I can create a CPaintDC device context in the global drawmycircle function. I think my problem is that the GetActiveWindow() function points to the CMainFrame class instead of the CChildView class. How do I make it point to the child frame?
Any hints would be extremely helpful. Thanks…