How to keep (and share) object in memory after program quits?

Discussion in 'C++' started by Arnold, Jan 26, 2004.

  1. Arnold

    Arnold Guest

    I need to modify my existing program into two separate executables. The
    first exe will be executed once to initiate a hardware card, the second
    program exe can be called multiple times to process data. The second program
    calls a member function of the first program so it needs access to the
    object created by the first exe. How can I do this?

    More if details if you are curious:
    I am writing a program which initializes and loads up a pci card, the whole
    process takes about 20 seconds since large files are copied to the card.
    This card is then accessed by a program which uses it to accelerate the
    processing of data files. Currently I put the initilization function at the
    start of main() so it loads up the card each time the program is executed.
    This is a waste of time since the card only need to be initialized once not
    every time. Therefore I need to make the initialization separate. The
    initialization process creates an object with a handle to the card. I cannot
    create multiple handles to the card as it can only be opened once. So the
    program need to have access to that handle. This program is meant to run on
    the commandline from a Windows system. The API the card came with has no
    functions to facilitate what I need to do.

    Intended operation:

    c:\myprogram\InitiateCard.exe
    Card initialized.

    \\card would be opened, initialized, and ready for use
    \\and would return me to the commandline after outputting
    \\small message

    c:\myprogram\process.exe test1.txt
    c:\myprogram\process.exe *.dat

    \\process can be called multiple times.
    \\when done, close the card.


    c:\myprogram\InitiateCard.exe quit

    \\close card


    At the present, process.exe just initiate the card each time it is called.

    I'm a junior programmer just out of college and this is my project for work.
    Thanks for any help guys.
     
    Arnold, Jan 26, 2004
    #1
    1. Advertising

  2. "Arnold" <> wrote...
    > I need to modify my existing program into two separate executables. The
    > first exe will be executed once to initiate a hardware card, the second
    > program exe can be called multiple times to process data. The second

    program
    > calls a member function of the first program so it needs access to the
    > object created by the first exe. How can I do this?


    You have to ask in a newsgroup that deals with your platform. C++
    _language_ has no means for inter-process communication or for some
    kind of out-of-process memory manipulation, so the best suggestion
    you can get is to store your information in a file and retrieve it
    later.

    Victor
     
    Victor Bazarov, Jan 26, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sebastian Loncar
    Replies:
    4
    Views:
    531
    Alvin Bruney - ASP.NET MVP
    Feb 28, 2006
  2. eftal
    Replies:
    0
    Views:
    410
    eftal
    Jan 25, 2006
  3. Prashanth  Ellina

    How do I know when a thread quits?

    Prashanth Ellina, Jun 7, 2005, in forum: Python
    Replies:
    6
    Views:
    327
    Peter Hansen
    Jun 9, 2005
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,410
    Saraswati lakki
    Jan 6, 2012
  5. code_wrong
    Replies:
    5
    Views:
    137
    Fred Oz
    Feb 15, 2005
Loading...

Share This Page