I'm writing a DLL and want to store information internally between
calls to the DLL functions.
For example:
static int i1,i2;
INT APIENTRY StoreInt1(int i) { return i1=i; }
INT APIENTRY StoreInt2(int i) { return i2=i; }
INT APIENTRY GetSum() { return i1+i2 }
I have all the definitions set up correctly... and the test program
compiles fine... but when I run the program:
StoreInt1(5);
StoreInt2(10);
int i = GetSum();
i != 15?
It seems like after the application leaves the DLL it losses all the
static information so when it calls it again, the variables are fresh.
I've also tried making the whole library a static library (.lib vs
..dll) but the same thing happens.
Any ideas?
Evan