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