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. General Programming
  3. C / C++ / MFC
  4. Refresh a view

Refresh a view

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
9 Posts 4 Posters 0 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.
  • M Offline
    M Offline
    Mughi
    wrote on last edited by
    #1

    Hi I have an view opened in my MDI application. And, after a execution of a specific process, the file which is viewed is modified. I want to refresh the view. How do i do that. Can someone please help me on this. I thank in advance. Cheers Mughi

    Y 2 S 3 Replies Last reply
    0
    • M Mughi

      Hi I have an view opened in my MDI application. And, after a execution of a specific process, the file which is viewed is modified. I want to refresh the view. How do i do that. Can someone please help me on this. I thank in advance. Cheers Mughi

      Y Offline
      Y Offline
      Yulianto
      wrote on last edited by
      #2

      UpdateAllviews(NULL);


      Work hard and a bit of luck is the key to success.

      :)

      M 1 Reply Last reply
      0
      • M Mughi

        Hi I have an view opened in my MDI application. And, after a execution of a specific process, the file which is viewed is modified. I want to refresh the view. How do i do that. Can someone please help me on this. I thank in advance. Cheers Mughi

        2 Offline
        2 Offline
        224917
        wrote on last edited by
        #3

        call Document's UpdateAllViews()
        There is no spoon. mail

        1 Reply Last reply
        0
        • M Mughi

          Hi I have an view opened in my MDI application. And, after a execution of a specific process, the file which is viewed is modified. I want to refresh the view. How do i do that. Can someone please help me on this. I thank in advance. Cheers Mughi

          S Offline
          S Offline
          Sujan Christo
          wrote on last edited by
          #4

          Hi U can call updateAllViews() which calls the update function which we have added. I do hope this may help you. Sujan

          M 1 Reply Last reply
          0
          • Y Yulianto

            UpdateAllviews(NULL);


            Work hard and a bit of luck is the key to success.

            :)

            M Offline
            M Offline
            Mughi
            wrote on last edited by
            #5

            I have tried this. But still, its not working. Where exactly should i implement this UpdateAllviews(NULL); Sorry for the inconvenience. thanx mughi

            Y 1 Reply Last reply
            0
            • M Mughi

              I have tried this. But still, its not working. Where exactly should i implement this UpdateAllviews(NULL); Sorry for the inconvenience. thanx mughi

              Y Offline
              Y Offline
              Yulianto
              wrote on last edited by
              #6

              Mughi wrote: Where exactly should i implement this UpdateAllviews(NULL); After finishing the process.


              Work hard and a bit of luck is the key to success.

              :)

              M 1 Reply Last reply
              0
              • Y Yulianto

                Mughi wrote: Where exactly should i implement this UpdateAllviews(NULL); After finishing the process.


                Work hard and a bit of luck is the key to success.

                :)

                M Offline
                M Offline
                Mughi
                wrote on last edited by
                #7

                Thats true. But my code flow is like this. All i have created is an MDI application of the following. class CComputeApp : public CWinApp class CComputeView : public CEditView class CComputeDoc : public CDocument 1. I haven't coded anything on File open / save / close. 2. Everything is taken care automatically. 3. Imagine a file named compute.txt is opened in my application. 4. And after that, I run a process (thats a different class) from CComputeApp. 5. And the process returns a string (contains the filename). 6. Using the string, i call CDocument* CComputeApp::OpenDocumentFile(LPCTSTR lpszFileName) to open the file. 7. The problem is, if the file is already opened, this OpenDocumentFile method doesn't call CComputeDoc::OnOpenDocument(LPCTSTR lpszPathName). 8. And so, the view is not updated. This is where my problem is. And thats why, i was curious about the place of code. Sorry for all the frustrations. And hope that, i would overcome this problem. Again, I thank in advance. thanx mughi

                Y 1 Reply Last reply
                0
                • S Sujan Christo

                  Hi U can call updateAllViews() which calls the update function which we have added. I do hope this may help you. Sujan

                  M Offline
                  M Offline
                  Mughi
                  wrote on last edited by
                  #8

                  Thats true. But my code flow is like this. All i have created is an MDI application of the following. class CComputeApp : public CWinApp class CComputeView : public CEditView class CComputeDoc : public CDocument 1. I haven't coded anything on File open / save / close. 2. Everything is taken care automatically. 3. Imagine a file named compute.txt is opened in my application. 4. And after that, I run a process (thats a different class) from CComputeApp. 5. And the process returns a string (contains the filename). 6. Using the string, i call CDocument* CComputeApp::OpenDocumentFile(LPCTSTR lpszFileName) to open the file. 7. The problem is, if the file is already opened, this OpenDocumentFile method doesn't call CComputeDoc::OnOpenDocument(LPCTSTR lpszPathName). 8. And so, the view is not updated. This is where my problem is. And thats why, i was curious about the place of code. Sorry for all the frustrations. And hope that, i would overcome this problem. Again, I thank in advance. thanx mughi

                  1 Reply Last reply
                  0
                  • M Mughi

                    Thats true. But my code flow is like this. All i have created is an MDI application of the following. class CComputeApp : public CWinApp class CComputeView : public CEditView class CComputeDoc : public CDocument 1. I haven't coded anything on File open / save / close. 2. Everything is taken care automatically. 3. Imagine a file named compute.txt is opened in my application. 4. And after that, I run a process (thats a different class) from CComputeApp. 5. And the process returns a string (contains the filename). 6. Using the string, i call CDocument* CComputeApp::OpenDocumentFile(LPCTSTR lpszFileName) to open the file. 7. The problem is, if the file is already opened, this OpenDocumentFile method doesn't call CComputeDoc::OnOpenDocument(LPCTSTR lpszPathName). 8. And so, the view is not updated. This is where my problem is. And thats why, i was curious about the place of code. Sorry for all the frustrations. And hope that, i would overcome this problem. Again, I thank in advance. thanx mughi

                    Y Offline
                    Y Offline
                    Yulianto
                    wrote on last edited by
                    #9

                    I hope i don`t get you wrong. I think I get the same problem with you before. I haven`t got the solution yet. I tried using CDocument::OnCloseDocument (if i`m not mistaken) and it close the application. I think we should code to call the File Close. :confused:


                    Work hard and a bit of luck is the key to success.

                    :)

                    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