-
November 29th, 2012, 01:08 PM
#1
What to do with OnNewDocument
Hi,
This may be a very newbie question.
I got a program from somebody. He had its initialization to run his program but never bothered to save the data for later use. Now I wanted to add the New, Open, Save, and Close to it, so I add OnNewDocument ahead of his program. It crashed every time I ran it.
Shall I include his initialization in the OnNewDocument? If I can not separate the initialization part from his code, e.g., they come in as dll, what shall do?
Thanks in advance
Jacob
-
November 29th, 2012, 01:57 PM
#2
Re: What to do with OnNewDocument
You have to debug this program to see where and why it crashes.
Besides, you didn't provide enough info about this projec tlike:
- is it MFC?
- is it MDI or SDI?
- is the Doc/View architecture used?
- what IDE are you using?
- ...
Victor Nijegorodov
-
November 29th, 2012, 04:26 PM
#3
Re: What to do with OnNewDocument
Victor,
Thanks for reply. Sorry for missing information.
It is MFC and MDI, and I use VC++ 6.0. I am not quite sure about the Doc/Vew architecture. I only know that it was based upon Spatial's ACIS+Hoops. The program I got allows me to drawing 3D models, but does not save/open files. That is why I am trying to add the document managing parts.
Since I don't have much access to the source code of the original program, I used OnNewDocument to set up a new doc, followed with that code. I hoped that the code would automatically read from and write to the new doc. I am not sure about the approach, would an executable code would communicate with a doc without telling it about where and who the doc is.
Jacob
-
November 29th, 2012, 04:58 PM
#4
Re: What to do with OnNewDocument
OnNewDocument is called when you create a new document. So there is no any "read from". Just create an empty document.
Well, you can then save trhis new created document. How would you save it depends only on you (well, maybe "somebody" has already implemented such a save)
Victor Nijegorodov
-
November 29th, 2012, 05:09 PM
#5
Re: What to do with OnNewDocument
I will arrange the code in the following way:
1. Use OnNewDocuemt to open a new doc;
2. Run the program I got afterwards;
3. Save it and see what is in it.
Will I see any results or their are some issues?
-
November 30th, 2012, 04:15 AM
#6
Re: What to do with OnNewDocument
It will only depend on your implementation of these three steps.
Victor Nijegorodov
-
November 30th, 2012, 07:59 AM
#7
Re: What to do with OnNewDocument
I had it implemented and will test it.
Thank you very much for the help
Jacob
-
November 30th, 2012, 08:03 AM
#8
Re: What to do with OnNewDocument
I had it implemented and will test it.
Thank you very much for the help
Jacob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|