-
July 9th, 2001, 01:33 PM
#1
How to dynamically load ActiveX controls at runtime?
The conventional way to load/create ActiveX control is to do it in the Resource Editor, 'Insert ActiveX Control', and the MFC ClassWizard will generate all the .cpp/.h files.
What if I have an ActiveX control registered in my system, and I want to dynamically create and run it in my dialog-based MFC application, at runtime? Should I use CreateControl or CoCreateInstance? Can someone post a simple code snipplet on how to achieve this? Thanks in advance.
-
July 9th, 2001, 03:06 PM
#2
Re: How to dynamically load ActiveX controls at runtime?
In an MFC application you should use CWnd::CreateControl.
Below is a sample that creates WebBrowser control:
if (!m_Browser.CreateControl(CLSID_WebBrowser, NULL, WS_VISIBLE|WS_CHILD,
CRect(0,0,100,100), this, nID))
return NULL;
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
|