Link to home
Start Free TrialLog in
Avatar of veeramani
veeramani

asked on

Windows 9x User defined global variable

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]


Avatar of simonet
simonet
Flag of Brazil image

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
Avatar of Madshi
Madshi

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.
ASKER CERTIFIED SOLUTION
Avatar of msedi
msedi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of veeramani

ASKER

Thanks Martin. I got the solution from your clu, thanks a lot.
veeramani