tags:

views:

23

answers:

1

Create an SDI application that incorporates the following object hierarchy. CVeiw<-(Class derived from CWnd)

• The CWnd class should response to all size notifications and resize accordingly. It should maximize itself to utilise the entire client area. • The class should be able to support the following interfaces. • ShowRectangle() - A rectangle should be drawn anywhere within the client area. • ShowCircle() - The first parameter being a structure that defines the dimension and colour of the circle. • Erase All – Clears the canvas. • The above methods within the class should be invoked when the user chooses Draw -> Circle, Draw -> Rectangle, Draw -> Erase from the menu.(Menu should be generated dynamically)

I have implemented the class Derived from CWnd and a window as child of CVeiw and added dynamic menu and hanlers of them inside Mainfrm.cpp file.

Now my problem is, How to draw on the canvas of child window when events are handled inside the Mainfrm.cpp??

A: 

You can also use the view class as a target for the menu events. Move the handlers out of the application class and into the view.

dwo
you may check my source code http://hotfile.com/dl/59489401/c9b5da6/SDIApplication.zip.html
onlybj
When archiving your projects, you can delete the Debug and Release folders, this makes you files a lot smaller!
dwo
Why the CChild class - you don't need to create a window to draw something, you already have the view-class to draw.
dwo