Doc/View is driving me crazy!
-
Hi, the subject is kind of vague so, let me explain. Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma: My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success. All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem. Please, can anyone help me out? Thanks, Frank PS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :)
-
Hi, the subject is kind of vague so, let me explain. Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma: My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success. All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem. Please, can anyone help me out? Thanks, Frank PS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :)
Hi ! Yes, the first time that you have to make something like that you have to made a lot of fucking tricks, it was hard for me too. There is a very good book that has a good example abou it, it's name is : " How to do it with Visual C++ 4.2", Here I don't have it so I can not give you the ISBN and so. In this book there is a very good example about one document and multiple views, give me your e-mail and I will send you the example ( I hope in the weekend ). Bye ! Braulio
-
Hi, the subject is kind of vague so, let me explain. Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma: My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success. All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem. Please, can anyone help me out? Thanks, Frank PS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :)
-
Hi ! Yes, the first time that you have to make something like that you have to made a lot of fucking tricks, it was hard for me too. There is a very good book that has a good example abou it, it's name is : " How to do it with Visual C++ 4.2", Here I don't have it so I can not give you the ISBN and so. In this book there is a very good example about one document and multiple views, give me your e-mail and I will send you the example ( I hope in the weekend ). Bye ! Braulio
Thanks Braulio! My email address is frankd@ce.net ================== The original message was: Hi !
Yes, the first time that you have to make something like that you have to made a lot of fucking tricks, it was hard for me too.
There is a very good book that has a good example abou it, it's name is : " How to do it with Visual C++ 4.2", Here I don't have it so I can not give you the ISBN and so. In this book there is a very good example about one document and multiple views, give me your e-mail and I will send you the example ( I hope in the weekend ).
Bye !
Braulio -
Hi, the subject is kind of vague so, let me explain. Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma: My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success. All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem. Please, can anyone help me out? Thanks, Frank PS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :)
Search MSDN for CDocument::AddView - i don`t know exactly where but they have a good example for SDI apps. If u still have a problem contact me - I`ll try to give you a code snipped whihc i use in my apps. Rajiv ================== The original message was: Hi, the subject is kind of vague so, let me explain.
Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma:
My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success.
All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem.
Please, can anyone help me out?
Thanks,
FrankPS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :)
-
Hi, the subject is kind of vague so, let me explain. Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma: My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success. All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem. Please, can anyone help me out? Thanks, Frank PS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :)
================== The original message was: Hi, the subject is kind of vague so, let me explain.
Several of the examples I've found on CodeGuru in regards to Switching views in an SDI application are good, but require custom classes. The ones that don't are not all that kind to us newbies. :) Like, no sample project. So, with that said...here's the dilemma:
My project is an SDI app. I want to use multiple views all attached to the same document. I also would like these views available all the time...ie not destroyed when showing the new one. OK, no problem...right? Well, for me it is. I've been trying to do this for about 2 weeks now with no success.
All the code examples I've found require a pointer to a class. That class must exist and be initialized before it is attached to the document. But HOW? I've tried adding them to the DocTemplate...I get a "New" window. I've tried creating them dynamically Create(blah, blah). For some odd reason, if the function to switch the view is based on CRuntimeClass It works, but when the function requires CView* pOldView, I have a problem.
Please, can anyone help me out?
Thanks,
FrankPS, sorry for the book I wrote above. Also, let me know if you need more info. I've got plenty on this one. :) Send me a E-Mail and I will be glad to send you code that does as you describe. I also have some at CodeGuru that does almost what yo say except that it does destroy the view but that can be chnges by commenting out one line of code Richard Stringer