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

A

Arnold

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.
 
V

Victor Bazarov

Arnold said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top