Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving and copying in MSVisual C++

Status
Not open for further replies.

whodaman

Programmer
May 23, 2001
60
CA
Hi, I just started using MS Visual C++ and i'm not too sure how to use the save functions. I have a variation of text, rectangles, and lines in an MDI (I think multiple documents something.) Well, the problem I have is in the save function call. I have the lines to write the codes... but I don't know how I can save or copy this graphic.

I'm guessing when I save, I would simply redraw everything I drew in the the original document. I'm really not too sure about this..

and as for the copying, would I be copying it into a BMP format? If so how would I do that too?

Thank you
 
I suppose you have an Document/View Application.

You should save your documents(data) through the Serialization method of your CDocument derived class.

For this:
- put all the data for your text, rectangles and lines (I mean strings, coordinates ...) as members of the CDocument derived class.
- in the OnDraw method of your CView derived class use for drawing ONLY this strings, coordinates ...

A very useful example for this is the Scribble tutorial which is included in the MFC Samples from the MSDN Samples.

Hope this helps,s-)


Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top