Solved

Windows 9x User defined global variable

Posted on 2000-04-25
4
149 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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 96
Dev Express grid collapse 2 45
Delphi Yen format 3 45
How to remove Recent Projects from Embarcadero C++ builder XE10. Berlin 2 66
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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