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. C / C++ / MFC
  4. Win32 - ActiveX question

Win32 - ActiveX question

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearningc++comjson
2 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.
  • S Offline
    S Offline
    Scozturk
    wrote on last edited by
    #1

    Hi! I am trying to integrate the DHTML editing control to a win32 dialog. For that I manually copy-pasted the code (CONTROL IDC_DHTML ....) from a mfc application resource to my win32 api application resource and I import the dhtmled.ocx. The program doesnt open when I click on it ( it also doesnt give an error message). Am I doing something wrong? Well... I am a beginner ...

    M 1 Reply Last reply
    0
    • S Scozturk

      Hi! I am trying to integrate the DHTML editing control to a win32 dialog. For that I manually copy-pasted the code (CONTROL IDC_DHTML ....) from a mfc application resource to my win32 api application resource and I import the dhtmled.ocx. The program doesnt open when I click on it ( it also doesnt give an error message). Am I doing something wrong? Well... I am a beginner ...

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

      MFC does a lot of work behind the scenes to pretend that you can place an ActiveX control in your resources and have it 'just work'. See the code in DLGCORE.CPP in the MFC source, particularly CDialog::CreateDlgIndirect, for more details. The Win32 dialog box API knows nothing of ActiveX controls and bombs out because it cannot find a suitable window class for the ActiveX control. If you want to host ActiveX controls in a raw Win32 application, you need to implement a control site (from memory, you need to at least implement the IOleContainer and IOleControlSite interfaces) and then create the controls yourself. For anyone who cares, MFC preprocesses the dialog template before passing it to Windows, stripping out (but remembering) any ActiveX control data and any list box initialisations (Win32 doesn't do this either). When Windows sends WM_INITDIALOG to the window, MFC actually calls CDialog::HandleInitDialog, which creates any ActiveX controls, initialises them, and performs any other control initialisations, before calling your override of OnInitDialog. In this way, it presents the illusion that ActiveX controls are controls like any other.

      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