"seems to loose the handle" ???
Do you mean, after returning to the process that uses the DLL the static variables are resetted??
Or are the variables uninitialized in another process that uses the same DLL?