|
-
July 19th, 1999, 11:47 AM
#1
Howto dynamically add an ActiveX control to an MFC window?
I can't seem to figure out what I need to do to add an ActiveX control to an MFC window (like CDialog) at runtime.
It must be possible since you can add one to a dialog template and you only have to add one line of code to InitInstance (AfxEnableControlContainer() . So somebody, MFC or Window's, knows how to do it.
-
July 19th, 1999, 12:02 PM
#2
Re: Howto dynamically add an ActiveX control to an MFC window?
You need to add the activeX to your project via the Project / Add To Project / Components and Controls menu option. This will create a dummy class to wrap the activeX control. Then in your window's OnCreate (or wherever you want), you just create your control via MyDummyClass.Create () (all controls are derived from CWnd).
HTH
--michael
-
July 19th, 1999, 04:13 PM
#3
Re: Howto dynamically add an ActiveX control to an MFC window?
My app will have no prior knowledge of the control, it will know only it's GUID.
I discovered the answer rather accidentally:
I was browsing through much and mire of MFC (the source code), and came across the CHtmlView class. It gave me the details I needed. CWnd::CreateControl.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|