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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problem about using ActiveX in DLL

problem about using ActiveX in DLL

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comdebugginghelp
5 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.
  • A Offline
    A Offline
    Arcrest
    wrote on last edited by
    #1

    in my regular MFC dll project, i create a dialog resource assoicated with a class CTestDlg, and it can normally show in my client application which uses the dll. But after i added a ActiveX control(IE Control, for example), the dialog can't be displayed and if i call a method of the ActiveX control, the debug assert failed dialog will appear: ASSERT(m_pCtrlSite!=NULL) fails. so how can i use ActiveX control correctly in DLL? thanks.

    C 1 Reply Last reply
    0
    • A Arcrest

      in my regular MFC dll project, i create a dialog resource assoicated with a class CTestDlg, and it can normally show in my client application which uses the dll. But after i added a ActiveX control(IE Control, for example), the dialog can't be displayed and if i call a method of the ActiveX control, the debug assert failed dialog will appear: ASSERT(m_pCtrlSite!=NULL) fails. so how can i use ActiveX control correctly in DLL? thanks.

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Make sure you call AfxEnableControlContainer() before using any ActiveX control.

      A 1 Reply Last reply
      0
      • C Cedric Moonen

        Make sure you call AfxEnableControlContainer() before using any ActiveX control.

        A Offline
        A Offline
        Arcrest
        wrote on last edited by
        #3

        Thanks i have already called AfxEnableControlContainer() in the InitIntstance in the dll project, but still get the same problem...

        C 1 Reply Last reply
        0
        • A Arcrest

          Thanks i have already called AfxEnableControlContainer() in the InitIntstance in the dll project, but still get the same problem...

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          Make sure also your activeX control is registered (I know this sounds like a stupid suggestion but you will have these kind of results if your ActiveX is not registered).

          A 1 Reply Last reply
          0
          • C Cedric Moonen

            Make sure also your activeX control is registered (I know this sounds like a stupid suggestion but you will have these kind of results if your ActiveX is not registered).

            A Offline
            A Offline
            Arcrest
            wrote on last edited by
            #5

            Thanks, but i use the IE control and i think it must be registered,:) i have got the solution from a forum: HRESULT hr = OleInitialize(NULL); if (hr == S_FALSE) { OleUninitialize(); } // Call if using OLE Controls AfxEnableControlContainer(); // Register all OLE server (factories) as running. This enables the // OLE libraries to create objects from other applications. COleObjectFactory::RegisterAll(); Thanks anyway~

            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