m_pCtrlCont->m_pSiteFocus = NULL;, was called m_pCtrlCont was NULL.After doing some debugging and digging around in CWnd code, I found that
m_pCtrlCont was supposed to be initialized in advance by a call to the MFC function
BOOL CWnd::InitControlContainer(BOOL bCreateFromResource);
because of its use of an ActiveX control. Apparently this is something that didn't always happen in old code but is now a problem. When later built with the new libraries, a window that contained an ActiveX control would cause a crash at run-time.The fix was simply a matter of adding a call to
InitControlContainer(TRUE); in my ActiveX control containing window's OnCreate event.