"?ystein Skotheim" <oystein@dontspam.me> ha scritto nel messaggio
news:g6p6ol$74s$1@kuling.itea.ntnu.no...
Perhaps I should say that I first ran into another problem with my
application in debug mode, namely a crash during startup telling
"Assertion Failed! Expression: _CrtIsValidHeapPointer(pUserData)." It
seems like this was caused by some native, global, static variables
(e.g. STL lists) present in "GcpsDotNetApi.dll". After searching on
the net for a while, I found a workaround telling me to force the
symbol define "__DllMainCRTStartup@12" to enable running of some CRT
initialization code. This made the error go away. I do not know if
the problem that I experience now might be related to the same issue.
Just for test, could you avoid "automatic" global/static variables
initialization, and instead pack them somewhere in a struct, and
*explicitly* call an initialization function?
e.g. the DLL exports something like "<DLL Name>_Init", so this
function does the initialization of the "global" variables, packed in
a struct. The client of the DLL explicitly calls this DLL initialization
function.
...just a test, to try to understand if this is the problem.
Giovanni