I am working on a very large application that uses CMutex and CSingleLock for synchronisation. I am told that this code worked perfectly under VC++ 6 but since rolling over to .NET (2003) there are problems.
The program will go down because of an ASSERT in line 90 of mtex.cpp (one of the afx files I think). I've located this file and here is the relavent code:
CSingleLock::CSingleLock(CSyncObject* pObject, BOOL bInitialLock)
ASSERT(pObject != NULL);
ASSERT(pObject->IsKindOf(RUNTIME_CLASS(CSyncObject))); //FAILS HERE
When this fires it appears that pObject passed to it appears to be a valid pointer to an object of type Win32ThreadResource which is one of our classes that inherits from CMutex (and doesn't appear to be more then a wrapper).
Anyway this code has worked for a very long time but under VS .NET it fires the above assert (then dies). Any ideas?