none
ActiveX with WebBrowser Control kills IE9

    Question

  • I am supporting an ActiveX written in VB6 that makes use of the WebBrowser Control to display some pages within it.

    Unfortunately when using the ActiveX via IE9 it causes the browser to lock up completely.

    The lock up occurs once the Navigation of the WebBrowser control completes (the page displays ok) the rest of the ActiveX up to that point works ok.

    There have been no issues with previous versions of IE (after tweaking security settings).

    I have turned off all the security I can find (just for testing) however this does not make a difference.

    Would appreciate any suggestions or information on whether or not IE9 supports the VB6 WebBrowser Control.

    Thanks

    Paul

     

    Wednesday, April 20, 2011 12:33 AM

All replies

  • Hi Paul,

    Since VB6 is out of support, it is not guarantee whether it is full compatible with IE9 based WebBrowser Control. However, as far as I know there is no compatible issue reported about VB6 and IE9.

    You may check the Internet Feature Controls to see if it helps. http://msdn.microsoft.com/en-us/library/ee330720(v=VS.85).aspx

    Cheers,

    Yi

     


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 25, 2011 9:19 AM
    Moderator
  • Hi Yi

        Thank you for your reply.

    I have had a good look at the Internet Feature Controls without any luck I'm afraid.

    Having switched all the relevant controls that I could find off without any improvement.

    I am leaning towards it being a VB6 issue so I will try a work around next.

    Seeya

    Paul

    Wednesday, April 27, 2011 6:52 AM
  • I've encountered the same problem. We have a vb6 built ActiveX control, that uses an embedded WebBrowser Control. When using this ActiveX control in an IE9 browser, everything locks up.

    I believe it's an event problem. In our case the contents of the webbrowser control will correctly display, but then immediately lock up. Through experimentation I've found that if I place a MsgBox call in the NavigateComplete2 event, nothing locks up. Why would that stop the browser from locking up? I guess because the MsgBox is a modal dialog box and it blocks/prevents some other event from firing or being handled, and in that code lies the error?

    Thanks,

    BD
    Tuesday, May 17, 2011 8:37 PM
  • I've encountered the same problem. We have a vb6 built ActiveX control, that uses an embedded WebBrowser Control. When using this ActiveX control in an IE9 browser, everything locks up.

    I believe it's an event problem. In our case the contents of the webbrowser control will correctly display, but then immediately lock up. Through experimentation I've found that if I place a MsgBox call in the NavigateComplete2 event, nothing locks up. Why would that stop the browser from locking up? I guess because the MsgBox is a modal dialog box and it blocks/prevents some other event from firing or being handled, and in that code lies the error?

    Thanks,

    BD


    Here's what I have found using vb6 controls with IE9. After closing a vb6 modal dialog called from a vb6 control hosted on a webpage the IE9 instance freezes. I can get it to unfreeze by CTRL+SHIFT+DELETE. This brings up an IE9 dialog box which, after you have cancelled it restores IE9 to a working condition. Here is the workaround I have added to my code after the call to show the modal dialog:

        Me.Show vbModal
        Call EnableParentWindows(Me.hwnd)
    ...

    Private Declare Function EnableWindow& Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long)

    Public Function EnableParentWindows(ByVal hwnd As Long) As Boolean
        ' This function is intended to fix the IE9 modal dialog freeze problem
        While hwnd <> 0
            EnableWindow hwnd, &O1
            hwnd = GetParent(hwnd)
        Wend
        EnableParentWindows = True
    End Function

    This works for me. It suggests that IE9 is disabling parent windows when a vb6 modal dialog is displayed but not re-enabling them when it closes.

    I do not know if this is the best solution. If anybody has any other vb6/IE9 compatibility issues/solutions I would like to hear from them.

    - Robert

     

    Tuesday, May 31, 2011 5:04 PM
  • That sounds like the modality issue Raymond Chen talked in his OldNewThing blog about the importance of set the parent/owner correctly. It is the VB6 runtime who disables the frame window, sometimes incorrectly, not IE9. Since IE's window hierarchy changed a lot in the last few versions, and VB6 did not, compatibility issue happens. 

    What happens if you make the form modal to the last modal popup or when there is no modal poup, the current tab window?



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, May 31, 2011 6:15 PM
  • The issue that described above re vb6 modal dialogs running under IE9 is specific to IE9. It does not occur in prior versions of IE. It is not a parentage issue nor is it the same as the vb6 modal dialog issue with IE7 which was fixed by an update to the vb runtime dll.

    IE9 also results in some other problems running VB6 code e.g. Using a VB6 frame control purely as a container with the BorderStyle set to '0 - None' but with the caption left as 'Frame 1'. In versions of IE prior to 9 the caption text is not displayed but in IE9 the caption text appears on the parent (without the frame lines) when it displays a modal dialog.

    Tuesday, May 31, 2011 8:00 PM
  • I am also facing a problem very similar described here

    I am using c# activex control. After performing any action with activex on IE9 switch to another tab and then popup message box is generates. After that IE9 hangs.

    The ActiveX in works fine in IE6, IE7 and IE8. This is problem with IE9 only when we switch to another tab.

    I have also try fix /2534409 MS11-050. But it show that not applicable.

    Any ideas related to this?


    • Edited by brinda.shah Tuesday, December 18, 2012 10:06 AM
    Tuesday, December 18, 2012 10:02 AM