I have a mainapplication, that loads a DLL - this DLL has a callback
function, which retrieves the address of a Class i have defined in the
mainapplication, which contains all global-allocations.
Now this works fine when im calling functions etc. from my DLL - but i get
an access violation as soon as i try to enter a critical section from this
class in the mainapp.
// in main
class __cGlobalClass
{
public:
CRITICAL_SECTION my_criticalsection_ole;
}
// in DLL
// MainGlobalClass this is a pointer to the __cGlobalClass in the main
(exchanged by a function).
....
......
EnterCriticalSection(&MainGlobalClass->m_CriticalSection_ole);
This causes an acces-violation......"write of address 0x00000010".
Its strange, because everything other than the critical_section is working
ok - do any of you have any suggestions ?