Simple problem across processes - need simplest answer 
Author Message
 Simple problem across processes - need simplest answer

I need to be able to pass an integer value between applications. I've looked
into this extensively and can't find an easy answer... I've got a number of
restrictions that nullify possible solutions:

- no Windows message "asking" for the current value of the integer - I don't
want to add this check and response to a number of apps
- not to the registry
- not to a file
- must be something I can implement not only in C++, but in VB as well

I'm already using a semaphore to determine which app is launched first
without any of the others running (and hence happens to set this value) and
that other apps subsequenly check the count of to see that they are not
first and in turn grab that value. I wish that there was a function where
you could easily create a global variable across apps and grab it via a
string label or something. I read up a bit on ATOMS and got e{*filter*}d at
first, then disappointed when I realized they weren't what I wanted.

Any thoughts?



Fri, 29 Apr 2005 21:05:28 GMT  
 Simple problem across processes - need simplest answer
Hi Chris

On Mon, 11 Nov 2002 15:05:28 -0500, "Chris Wise"

Quote:

>I need to be able to pass an integer value between applications. I've looked
>into this extensively and can't find an easy answer... I've got a number of
>restrictions that nullify possible solutions:

The only thing you did not exclude was Shared Memory.

Have a look at:
CreateFileMapping
MapViewOfFile
OpenFileMapping
UnmapViewOfFile

If you exclude this too, then nothing else is left ;-)

Best Regards
Walter



Fri, 29 Apr 2005 21:58:15 GMT  
 Simple problem across processes - need simplest answer

Quote:
> Hi Chris

> On Mon, 11 Nov 2002 15:05:28 -0500, "Chris Wise"

> >I need to be able to pass an integer value between applications. I've
looked
> >into this extensively and can't find an easy answer... I've got a number
of
> >restrictions that nullify possible solutions:

> The only thing you did not exclude was Shared Memory.

> Have a look at:
> CreateFileMapping
> MapViewOfFile
> OpenFileMapping
> UnmapViewOfFile

> If you exclude this too, then nothing else is left ;-)

Yeah there is...

Create an out of process COM server that only allows one instance. In it
have your *global* variable. Just add the methods you need and away you go.

Actually, that ought to be very simple indeed. A mere 'follow the wizard'
exercise in VC and maybe even simpler in VB.

Any more...?

Oh, what about shared memory segment in a DLL that the apps load using load
library. The DLL would expose the methods for setting and getting the
integer value.

Nope, can't think of any more ;)

--
russ.
http://www.gipsysoft.com/articles/winspector/ - FREE Spy++ replacement.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids



Fri, 29 Apr 2005 23:23:02 GMT  
 Simple problem across processes - need simplest answer


Quote:
> I need to be able to pass an integer value between applications. I've
> looked into this extensively and can't find an easy answer... I've got
> a number of restrictions that nullify possible solutions:

This is probably quite late but:

A database that stores your values.
A text file that contains your information and is locked to prevent
multiple accesses.
A DDE server.
TCP/IP sockets.



Sun, 08 May 2005 21:28:27 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. I need some Simple C answers

2. Help... V Simple Questions Need Answering

3. Need answer for probably very simple question...

4. Need simple example of creating a thread (during a long process)

5. Simple ATL Com object problem on simplest examples

6. Newbie needs help on simple problem

7. Need help on simple problem

8. need help with simple rand problem

9. Very Simple Problem - NEED HELP PLEASE

10. A Simple Problem, Need Help

11. A simple question, but still no answer

12. simple question, pls answer\

 

 
Powered by phpBB® Forum Software