Release build crash pWndParent->m_pCtrlCont->AttachControlSite(this);

Hi,

I have an application using RichEdit 2.0 controls in a SDI FormView. When linked against the release version of the MFC library it crashes
on the pWndParent->m_pCtrlCont->AttachControlSite(this); call in

void CWnd::AttachControlSite(CHandleMap* pMap)
{
      if (this != NULL && m_pCtrlSite == NULL)
      {
            // Determine if parent is an OLE control container
            CWnd* pWndParent = (CWnd*)pMap->LookupPermanent(::GetParent(m_hWnd));
            if (pWndParent != NULL && pWndParent->m_pCtrlCont != NULL)
            {
                  // delegate through helper in COleControlSite
                  pWndParent->m_pCtrlCont->AttachControlSite(this);
            }
      }
}

(WINOCC.CPP)

I compiled my program with debug information linked against the Release version of MFC and stepped into the crash and  it occurs after a PumpMessage call deep within MFC :-( I am rather puzzled about this problem and would appreciate any suggestions to resolve this.

I already checked my message handlers for correct format so I dont think it is caused by any of my costum registered window messages...

Confused greetings,
Thees.

Bender979Asked:
Who is Participating?
 
vijay_visanaConnect With a Mentor Commented:
There can be many reasons so following article give you very good insight in release problem
go thru it.

http://www.codeproject.com/debug/survivereleasever.asp
0
 
Bender979Author Commented:
Thanks, but I ran through the issues mentioned there already before posting here.
My message handlers have the correct format, it also happens with compiler optimizations turned off etc. pp.

:-(
0
 
Bender979Author Commented:
shame and even bigger shame on me, lol OK OK OK I overlooked a wrong message handler *hide in corner*

happens if you sit too long in front of your computer, lol. Cheers.
0
All Courses

From novice to tech pro — start learning today.