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. how to go about...

how to go about...

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 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.
  • A Offline
    A Offline
    aarontan
    wrote on last edited by
    #1

    Hi, How to go about getting data from another running application? This is wat I am trying to do. There is program A running and storing data in the hard disk. I am creating a program which will retrive the real time data. This means that when i open the program, it will retrive the current data that program A is recording. However I do not run program B when A is running. I will run B as and when needed. Any idea? :confused: Aaron

    C B 2 Replies Last reply
    0
    • A aarontan

      Hi, How to go about getting data from another running application? This is wat I am trying to do. There is program A running and storing data in the hard disk. I am creating a program which will retrive the real time data. This means that when i open the program, it will retrive the current data that program A is recording. However I do not run program B when A is running. I will run B as and when needed. Any idea? :confused: Aaron

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can't - if program A is writing to disk, it will own the file until it closes it. Are you writing both programs ? If so, you should look into some interprocess communication to send this data, bypassing the file. Otherwise, you can't do it so long as program A has the file open. Christian Graus - Microsoft MVP - C++

      T 1 Reply Last reply
      0
      • A aarontan

        Hi, How to go about getting data from another running application? This is wat I am trying to do. There is program A running and storing data in the hard disk. I am creating a program which will retrive the real time data. This means that when i open the program, it will retrive the current data that program A is recording. However I do not run program B when A is running. I will run B as and when needed. Any idea? :confused: Aaron

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #3

        Did you wrote program A? If not, than you might be in some trouble. If you wrote program A, you should change the part where you open the file for writing and modify it so it shares access to it. Read here[^] for more information on sharing files. If you did not write program A, you can try to open the file that shares all access to it. This way, there might be a chance that you can access the file if program A did not deny all access.. Good luck. Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

        A 1 Reply Last reply
        0
        • B Bob Stanneveld

          Did you wrote program A? If not, than you might be in some trouble. If you wrote program A, you should change the part where you open the file for writing and modify it so it shares access to it. Read here[^] for more information on sharing files. If you did not write program A, you can try to open the file that shares all access to it. This way, there might be a chance that you can access the file if program A did not deny all access.. Good luck. Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

          A Offline
          A Offline
          aarontan
          wrote on last edited by
          #4

          ok tks will look into the share format of the file. If i set it to share read, logically it should work. rite? Aaron

          B 1 Reply Last reply
          0
          • A aarontan

            ok tks will look into the share format of the file. If i set it to share read, logically it should work. rite? Aaron

            B Offline
            B Offline
            Bob Stanneveld
            wrote on last edited by
            #5

            Maybe, if the other program didn't open the file without sharing the file for writing. I think that it is better to open the with sharing all access. That way, you will be sure that you don't deny some access that program A has. Also be sure to open the file READ_ONLY. Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

            1 Reply Last reply
            0
            • C Christian Graus

              You can't - if program A is writing to disk, it will own the file until it closes it. Are you writing both programs ? If so, you should look into some interprocess communication to send this data, bypassing the file. Otherwise, you can't do it so long as program A has the file open. Christian Graus - Microsoft MVP - C++

              T Offline
              T Offline
              Toby Opferman
              wrote on last edited by
              #6

              Not true, you can set the "sharing" parameters so another application can read from a file while you write to it. 8bc7c0ec02c0e404c0cc0680f7018827ebee

              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