Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows 9x User defined global variable

Posted on 2000-04-25
4
Medium Priority
?
153 Views
Last Modified: 2010-04-04
I need to create user variables in Windows memory to which i have to store some values.Then, that variable should be accessed or modified by other programs.
ex. 1)Application A is running and keep on changing the Windows Global Variable X,Y,Z
    2)Application B is running and keep on changing the Windows Global Variable X,Y,Z
    3)Application c is running and keep on changing the Windows Global Variable X,Y
Here, Application A,Application B,Application C are independent applications.
How to achieve this? [How to create the Varriable and How to modify the varriable]


0
Comment
Question by:veeramani
4 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2750222
Why not use a Registry key instead? It's much easier than dealing with shared memory (mapped memory), and the like.

By using the Registry, with just a few lines you're able to read/write a variable. Besides, Delphi provides built-in support (TRegIniFile and TRegistry) to easily handle the Registry.

Alex
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2750264
Alex is right. The registry is the most convenient way of doing stuff like that.
But if you want to go the "official" way, you should use CreateFileMapping(-1, ...) & MapViewOfFile. I think there was a component here:

http://www.jgsoftware.com/nt.htm

But if I remember right, the component had one or two minor bugs.

Regards, Madshi.
0
 
LVL 1

Accepted Solution

by:
msedi earned 400 total points
ID: 2750718
Hello,
maybe you can use Atoms to achieve this.
Just convert the values into string values and reconvert them after access into the specified value. The functions are GlobalAddAtom, FindAtom,...

Good luck,
Martin
0
 
LVL 1

Author Comment

by:veeramani
ID: 2750756
Thanks Martin. I got the solution from your clu, thanks a lot.
veeramani
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question