本人将一个含Flash.ocx控件的 窗口封装到 MFC扩展DLL中,用导出函数将其显示出来,注意,框框的显示是在导出函数中,然后在DLL中销毁这个框框时,报错了,如下:
------------------------------------------------------------------------
  mfc71d.dll!COleControlSite::DoVerb(long nVerb=-3, tagMSG * lpMsg=0x00000000)  Line 675 + 0x3c C++
  mfc71d.dll!COleControlSite::ShowWindow(int nCmdShow=0)  Line 1334 C++
  mfc71d.dll!COleControlSite::DestroyControl()  Line 310 C++
  mfc71d.dll!CWnd::DestroyWindow()  Line 990 + 0x11 C++
  mfc71d.dll!CWnd::~CWnd()  Line 758 C++
> Pel.dll!PLBASE::CFlashocx::`vbase destructor'()  + 0x39 C++
  Pel.dll!PLBASE::CFlashWnd::~CFlashWnd()  Line 53 + 0x24 C++
  Pel.dll!PLBASE::FlashRenderObject::~FlashRenderObject()  Line 44 + 0xf C++
  Pel.dll!PLBASE::FlashRenderObject::`scalar deleting destructor'()  + 0x2b C++
  Pel.dll!PLBASE::RenderPriorityGroup::DestroyRenderList()  Line 37 + 0x32 C++
  Pel.dll!PLBASE::RenderQueue::clear()  Line 89 C++
  Pel.dll!PLBASE::RenderQueue::~RenderQueue()  Line 79 C++
  Pel.dll!PLBASE::CRenderManager::~CRenderManager()  Line 28 + 0x29 C++
  Pel.dll!PLBASE::CRenderManager::`vector deleting destructor'()  + 0x69 C++
  Pel.dll!PLBASE::PCore::Release()  Line 48 + 0x35 C++
  Pel.dll!PLBASE::PCore::~PCore()  Line 30 C++
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$跟踪一把显示是,在删除CFlashocx这个控件时,会调用
 BOOL COleControlSite::DestroyControl()
{
POSITION pos;
if( m_hWnd != NULL )
m_pCtrlCont->m_siteMap.RemoveKey(m_hWnd);
ShowWindow(SW_HIDE);
......
其中ShowWindow(SW_HIDE)会调用HRESULT COleControlSite::DoVerb(LONG nVerb, LPMSG lpMsg),这个时候就报错了。哪个大哥能知道是什么原因啊?小弟感激不尽!十万火急!!!

解决方案 »

  1.   

    在dll中销毁另外可能要先使flash.ocx获得焦点::SetFocus()
      

  2.   

    To Elysium(東鱗覀爫) :
      SetFocus()不起作用喔
      

  3.   

    急啊....呜....搞不定,是不是我的主程序还是DLL设置错了
      

  4.   

    搞定了,原来是主程序的析构顺序有问题,必须在APP退出前,将DLL中的资源释放掉,如果DLL中的资源是new出来的话,MFC框架结构就管理不了了,如果等到~APP时,就为时已晚,晕,