MFC WEBBROWSER2控件的一个BUG

  FIX:   WebBrowser   Control   Destroyed   When   Hidden    
   
  --------------------------------------------------------------------------------  
  The   information   in   this   article   applies   to:  
   
  Microsoft   Internet   Explorer   (Programming)   versions   4.0,   4.01    
  The   Microsoft   Foundation   Classes   (MFC)    
  Internet   Client   SDK,   versions   4.0,   4.01  
   
  --------------------------------------------------------------------------------  
   
   
  SYMPTOMS  
  The   Microsoft   WebBrowser   control   is   used   in   a   Microsoft   Foundation   Class   (MFC)   application   and,   following   the   dynamic   creation   of   the   control   or   call   to   ShowWindow(SW_HIDE),   results   in   the   control's   methods   not   functioning   or   a   debug   assertion   in   Winocc.cpp.    
   
   
   
  CAUSE  
  If   the   WebBrowser   control   is   created   dynamically   without   specifying   the   WS_VISIBLE   window   style,   or   if   the   control's   ShowWindow(SW_HIDE)   method   is   called,   this   results   in   a   call   to   the   control's   IOleControl::DoVerb()   method   with   the   OLEVERB_HIDE   verb.   This   in   turn   causes   the   instance   of   Internet   Explorer   to   be   destroyed,   preventing   further   access   to   the   control's   methods,   or   if   built   with   a   debug   configuration,   the   application   asserts   when   CWnd   methods   are   called   for   the   control.    
   
   
   
  RESOLUTION  
  Specify   the   WS_VISIBLE   window   style   when   dynamically   creating   a   WebBrowser   control   and   do   not   call   the   control's   ShowWindow(SW_HIDE)   method.    
   
   
   
  STATUS  
  Microsoft   has   confirmed   this   to   be   a   bug   in   the   Microsoft   products   listed   at   the   beginning   of   this   article.   This   bug   was   corrected   in   Microsoft   Internet   Explorer   5.  
   
   
   
  MORE   INFORMATION  
  If   you   need   to   hide   the   WebBrowser   control,   call   the   Windows   SDK   ShowWindow()   API   directly.    
   
  Use   the   following   code   to   hide   the   control:    
   
   
  ::ShowWindow(   m_Control.GetSafeHwnd(),   SW_HIDE   );    
  Use   the   following   code   to   show   the   control:    
   
  ::ShowWindow(   m_Control.GetSafeHwnd(),   SW_SHOW   );    
  ©   Microsoft   Corporation   1998,   All   Rights   Reserved.  
  Contributions   by   Mark   Davis,   Microsoft   Corporation  
   
   
  Additional   query   words:    
   
  Keywords   :   kbIE400bug   kbIE401bug   kbIE500fix    
  Version   :    
  Platform   :    
  Issue   type   :   kbbug    
  Technology   :    
   
   
  Last   Reviewed:   April   8,   1999  
  ©   2000   Microsoft   Corporation.   All   rights   reserved.   Terms   of   Use.   
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值