I am trying to upgrade a legacy product from VC6 to VS2013 using toolset 12_xp. I can get the project to compile just fine however I am getting a runtime ASSERT and it seems related to CSingleLock lock() call.
CSingleLock slock(&CV7CmnSS::m_cs); // Wait for access
slock.Lock(m_dwTimeout); // <- this is the line that does it.
CV7CmnSS::m_cs is declared as a static object in a different class in another dll refrenced by this project.
the exe's header file has this CCriticalSection CV7CmnSS::m_cs;
as declared in CV7CmnSS header file static CCriticalSection m_cs;
I try to step through the MFC code (I know, i know...) this is about all the further I can get...
mfc120d.dll!CCriticalSection::Lock(unsigned long dwTimeout) Line 118 C++ //<-- from the call stack window
_AFXMT_INLINE BOOL (::CCriticalSection::Lock(DWORD dwTimeout))
{
ASSERT(dwTimeout == INFINITE);
(void)dwTimeout;
return Lock();
}
the assert I box i get:
fairly generic..
Both the dll project are targeting the same toolset, 12_xp, both use MBCS, both are using MFC as a shared dll. Both are using Multithreaded debug dll setting.
I suspect a cross threading issue? But I am not sure how to proceed.
If there is anymore info I can provide please let me know.
EDIT:
I forgot to add this little gem, if I run the program in release without debugging I am able to get a little further with the app, however this strange message pops up....

