Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Doc/View is driving me crazy!

Doc/View is driving me crazy!

Scheduled Pinned Locked Moved IT & Infrastructure
helpquestionlearning
6 Posts 4 Posters 19 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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. :)

    L M R R 4 Replies Last reply
    0
    • L Lost User

      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. :)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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

      L 1 Reply Last reply
      0
      • L Lost User

        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. :)

        M Offline
        M Offline
        Martin
        wrote on last edited by
        #3

        You should really make an MDI app and limit it to one document. Will make your life much easier. Martin

        1 Reply Last reply
        0
        • L Lost User

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • L Lost User

            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. :)

            R Offline
            R Offline
            Rajiv Ramachandran
            wrote on last edited by
            #5

            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,
            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. :)

            1 Reply Last reply
            0
            • L Lost User

              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. :)

              R Offline
              R Offline
              Richard Stringer
              wrote on last edited by
              #6

              ================== 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,
              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. :) 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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups