Solved

Windows 9x User defined global variable

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now