DLL shared variables problem
Posted on 2003-03-03
I have writen a DLL which is used by several different apps
There are 2 global variables (called started and currentLoggedLevel) that I want to be shared so that if one app makes started=TRUE, every other app sees started as true.
The way I have tried to go about this is to declared the variables as follows:
#pragma data_seg (".shared")
bool started = false;
int currentLoggedLevel = -1;
and then to include the following in my .DEF file
.shared READ WRITE SHARED;
This does not seem to work, and if one application makes started=TRUE, the others still see it as false.
My question is should this technique work i.e. have I got the right idea but have probably done something wrong somewhere else (if not, what technique could I use to achieve this "shared" behaviour ?).