Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to keep (and share) object in memory after program quits?

Reply
Thread Tools

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

 
 
Arnold
Guest
Posts: n/a
 
      01-26-2004
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.


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      01-26-2004
"Arnold" <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How keep python socket alive for ever by setting Keep alive flag. hisan Python 1 06-25-2012 05:30 PM
ruby/tk How do I keep program running with focus after runningexternal progam Ed Redman Ruby 1 09-11-2007 10:29 PM
Strange Java issue -- program quits after 370megs of memory usage... eftal Java 0 01-25-2006 07:58 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM



Advertisments