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. Dialog Based ActiveX Control

Dialog Based ActiveX Control

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++visual-studiocom
2 Posts 2 Posters 1 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
    MissingLinkError
    wrote on last edited by
    #1

    I have created an ActiveX Control using VC6 with MFC Automation built in. I'm able to add the control to a VB6 form and run it successfully(for most parts : I'm not able to observe any of the events fired within the control). Anyway, the real problem is when I try to use the ActiveX control in a VC6 Dialog based app. it crashes on me at design time, right after I 'Insert ActiveX Control' into the Dialog. It triggers a 'Debug Assertion' within the MS VC6 IDE and then shuts down the IDE. Verrrry frustrating... I think I may have narrowed it down to the OnDraw method for the control: Within the Control I have a member called 'configPanel' derived from CDialog, which is used to control runtime settings for the Control. It contains several components: buttons, edit box, check boxes, etc... I've implemented the OnCreate for the Control, as well as for the child 'configPanel'. I'm using the MoveWindow to size and position the 'configPanel'. See code below. This works fine in the VB6 container but won't even place the component in the CDialog container at design time. Note: the code below will work using the GDI functions, but bombs with the 'MoveWindow'. How do I go about rendering the child dialog 'configPane' and its control components(button, edit box, etc...)???? void CSomeCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid) { CBrush brBackGrn(RGB(255,100,100)); pdc->FillRect(rcBounds, &brBackGrn); CRect rcPanelRect(rcBounds.TopLeft(),CSize(rcBounds.Width(),rcBounds.Height()/4)); // configPanel.MoveWindow(rcPanelRect,TRUE); } Someone please enlighten me! You are my last, greatest hope... MissingLinkError

    N 1 Reply Last reply
    0
    • M MissingLinkError

      I have created an ActiveX Control using VC6 with MFC Automation built in. I'm able to add the control to a VB6 form and run it successfully(for most parts : I'm not able to observe any of the events fired within the control). Anyway, the real problem is when I try to use the ActiveX control in a VC6 Dialog based app. it crashes on me at design time, right after I 'Insert ActiveX Control' into the Dialog. It triggers a 'Debug Assertion' within the MS VC6 IDE and then shuts down the IDE. Verrrry frustrating... I think I may have narrowed it down to the OnDraw method for the control: Within the Control I have a member called 'configPanel' derived from CDialog, which is used to control runtime settings for the Control. It contains several components: buttons, edit box, check boxes, etc... I've implemented the OnCreate for the Control, as well as for the child 'configPanel'. I'm using the MoveWindow to size and position the 'configPanel'. See code below. This works fine in the VB6 container but won't even place the component in the CDialog container at design time. Note: the code below will work using the GDI functions, but bombs with the 'MoveWindow'. How do I go about rendering the child dialog 'configPane' and its control components(button, edit box, etc...)???? void CSomeCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid) { CBrush brBackGrn(RGB(255,100,100)); pdc->FillRect(rcBounds, &brBackGrn); CRect rcPanelRect(rcBounds.TopLeft(),CSize(rcBounds.Width(),rcBounds.Height()/4)); // configPanel.MoveWindow(rcPanelRect,TRUE); } Someone please enlighten me! You are my last, greatest hope... MissingLinkError

      N Offline
      N Offline
      nguyenvhn
      wrote on last edited by
      #2

      I am not realy sure the problem but I think you should move: CRect rcPanelRect(rcBounds.TopLeft(),CSize(rcBounds.Width(),rcBounds.Height()/4)); configPanel.MoveWindow(rcPanelRect,TRUE); to OnSize event handler.

      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