Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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??
Posted
Updated 2-Aug-10 20:58pm
v3
Comments
Richard MacCutchan 3-Aug-10 5:34am    
Sorry, but I do not have the facilities or time to download and review your source code. Try looking at the documentation and samples on the net for further suggestions. If, as I suspect, this is a school or college assignment then you should spend some more time with your notes and talk to your tutor.
Bhavin Jagad 3-Aug-10 6:11am    
thanks a lot,
ya, you are right.
this is self study subject for us. So i am little bit confused with which book is preferable. Would you suggest any book or any internet source.

1 solution

It's some time since I used MFC but I think the general flow is that you add values to your CDocument object which describe the shapes and their location, and then call UpdateAllViews(). Then in your view's OnPaint() method you display the relevant shapes on your View.
 
Share this answer
 
Comments
Bhavin Jagad 3-Aug-10 5:00am    
here is my source code..
i don't know what to next..
help me
http://hotfile.com/dl/59489401/c9b5da6/SDIApplication.zip.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900