![]() |
CreateControl too "early"
I'm a noob to MFC, and a noob to this site :)
I'm trying to add a windowless active X control to a CWnd dialog. The problem is, if I attach my control during OnInitDialog, the control is later detached via COleControlSite::DetachWindow, and is therefore not shown. I can get it to work by creating my control later, when the parent control is getting a WM_SIZE message for the second time...but this is really hacky and I don't understand it. So...the below code works, but I'd rather not have the hack / understand what's going on Code:
CParentControl::CParentControl() |
Re: CreateControl too "early"
Obviously "COleControlSite::DetachWindow" should be
Code:
COleControlSite::DetachWindow |
Re: CreateControl too "early"
Got it working by using a second wrapper (an activeX control). The code for adding the child control then, looks like this:
Code:
void CreateChild () |
| All times are GMT +5.5. The time now is 07:48. |