0

I have an embedded CMFCListCtrl in report mode inside a CFormView derived class. The View also has an embedded toolbar. One of the buttons calls the CDHTMLDialog.

Everything works fine up to that point. The Dialog opens. Here is the problem:

If I open the CDHTMLDialog and close the app: No errors.

If I first populate the CMFCListCtrl. Call the CDHTMLDialog and close the app. I First get an access violation and a break point on AfxDeactivateActCtx with the following errors:

First-chance exception at 0x78b64f64 (mfc90ud.dll) in PManager.exe: 0xC0000005: Access violation reading location 0x00000000075f3d70. First-chance exception at 0x771eb3dc in PManager.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one. First-chance exception at 0x771eb3dc in PManager.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one. First-chance exception at 0x771eb3dc in PManager.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one. First-chance exception at 0x771eb3dc in PManager.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one. Unhandled exception at 0x771eb3dc in PManager.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one.

I have tried literally everything and have not found a solution.

RobNHood
  • 119
  • 1
  • 2
  • 11
  • You may want to look here http://stackoverflow.com/questions/7659127/createex-causes-unhandled-exception-the-activation-context-being-deactivated-is – demonplus Apr 25 '15 at 09:36
  • I am not calling create. The dialog is not modeless. I am calling the DoModal() method and have not made any alterations yet to the template supplied when the CDHTMLDialog class is created. – RobNHood Apr 25 '15 at 09:39
  • And if you comment DoModal() call everything works correctly? – demonplus Apr 25 '15 at 09:43
  • No I initially called DoModal() method after creating the class and it tripped the break point both in debug and crashed in release. Then I tried making it modeless so I could destroy it when the view was destroyed and same exact outcome. Now I am back with Domdal(). Strange thing is if I don't populate the report items it closes fine. It is only when I populate the report and call the dialog that it occurs. I needed the dialog to display info based on the selected items in the report so the report will need to be populated. – RobNHood Apr 25 '15 at 09:47
  • And do you already pass the information about these items to the dialog? It may be something wrong with this part. Can you post some code? – demonplus Apr 25 '15 at 09:49
  • Sorry misread your comment. Yes I commented out domodal and just left the initialization member everything works fine. its just when I pull up the dialog then close out the app after closing the dialog. – RobNHood Apr 25 '15 at 09:50
  • This is all I do to call it.. the normal way: CEditorSampler m_editorsampler; //m_editorsampler.DoModal(); the dialog itself has no member variables yet except for the standard ones ie OK and Close buttons – RobNHood Apr 25 '15 at 09:51

0 Answers0