Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Getting Exception when two instance of ActiveX control are opened using Ctrl+N in IE

Getting Exception when two instance of ActiveX control are opened using Ctrl+N in IE

Scheduled Pinned Locked Moved COM
c++comdebuggingannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Muhammad Azam
    wrote on last edited by
    #1

    Hi, I have developed a MFC ActiveX control and embeded it in IE. The control is working fine but when another instance of IE is opened using Ctrl+N, I am getting ASSERT exception in debug mode and in Release mode IE crashes. Note that if the second instance is opened without using Ctrl+N (i.e by using explorer icon) no exception arrises. what could be wrong. your support is highly appreciated. Thanks Muhammad Azam

    M 1 Reply Last reply
    0
    • M Muhammad Azam

      Hi, I have developed a MFC ActiveX control and embeded it in IE. The control is working fine but when another instance of IE is opened using Ctrl+N, I am getting ASSERT exception in debug mode and in Release mode IE crashes. Note that if the second instance is opened without using Ctrl+N (i.e by using explorer icon) no exception arrises. what could be wrong. your support is highly appreciated. Thanks Muhammad Azam

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      You've obviously got a problem with your control when more than one instance of it is created. This is probably a threading issue since IIRC Internet Explorer creates a new thread for each browser window. If your control is marked apartment-threaded (which it is, by default), then the second instance of your control will be running on a different thread from the first. When a second instance is opened by using the icon, a new IEXPLORE.EXE process is created. This gives a whole new address space, so the problem does not occur. It might help diagnose the problem if you post the file and line number on which the ASSERT occurs. Stability. What an interesting concept. -- Chris Maunder

      M 1 Reply Last reply
      0
      • M Mike Dimmick

        You've obviously got a problem with your control when more than one instance of it is created. This is probably a threading issue since IIRC Internet Explorer creates a new thread for each browser window. If your control is marked apartment-threaded (which it is, by default), then the second instance of your control will be running on a different thread from the first. When a second instance is opened by using the icon, a new IEXPLORE.EXE process is created. This gives a whole new address space, so the problem does not occur. It might help diagnose the problem if you post the file and line number on which the ASSERT occurs. Stability. What an interesting concept. -- Chris Maunder

        M Offline
        M Offline
        Muhammad Azam
        wrote on last edited by
        #3

        Thanks a Lot Mike, your answer has given me a new dimension to think. first of all i need to know 2 things 1. what is

        Mike Dimmick wrote:

        IIRC Internet Explorer

        and what it does? 2. how co i know whether my control is

        Mike Dimmick wrote:

        marked apartment-threaded

        and is the problem due to the fact that you wrote:

        Mike Dimmick wrote:

        your control is marked apartment-threaded (which it is, by default), then the second instance of your control will be running on a different thread from the first.

        yes the line where i am getting the Assert is, when i try to access Frame window ( that i have created in my control) using AfxGetApp()->m_pMainFrame or AfxGetMainWnd(). thanks once again for your response Muhammad Azam

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups