Is there a way to declare variables as Universal so I can access them in any project so I don't have to use files to share them..?
Thanks in advance!
Printable View
Is there a way to declare variables as Universal so I can access them in any project so I don't have to use files to share them..?
Thanks in advance!
as in have 2 seperate projects and a variable they can both access, no.
The best way to get 2 standard exes to talk is to use send message.
you can have something a bit like a shared variable using something called a filemapping, you'd need to set up a property in each of your projects to do it and I'm not sure exactly how to do It. I'll look into it if you want.
There is no easy way of sharing variables across projects. The only way I know of is to create a DLL and share it that way.
You can even use winsock to trans. values to eacht program
you have created.. :) Or you can use files to trans. those
values. :). My men. There are many way's to do it.. :)
But wiSh one woUld be tHe besT. I dUnO......
Strange. Aint it.. :)
If you are really into this (at least on WinNT!), you can use API to create shared memory (I'm not sure if it works on other platforms). This memory can then be accessed from two (or more) executables. YOu can store what you like in it.
It has to be used carefully though, with locks so that only one exe can read/write to the shared memory at one time.
I can provide more info if you want...e-mail me.
:cool:
Dan
Unfortunately I'm coding for Win95/98 too. (The program should run on any win os). Well, thank you all for the answers. Eh Sam, how would you send messages? Or better: How does the other program know if there comes a message from the first program, that it has to take care about? I mean, VB is handling the WMs for us..?
However, I think files are the easiest way... will take that.