Solved

ActiveX Control as a container

Posted on 1998-06-22
2
263 Views
Last Modified: 2013-11-20
Hi,
Is it possible to have an activeX control also serve as a container to load other activeX controls?  I have manually inserted the correct include in stdafx.h "#include <afxdisp.h>"  and called  "AfxEnableControlContainer();" into the control's InitInstance.

The following is a code snippet from a dialog class that that creates the control.  If I embed this dialog
class in an .exe, the createcontrol works.  If I embed this
dialog class in an activex control, the createcontrol call fails (without returning a meaningful error code).

RECT MySize = {0,0,400,400};
m_nID = 10;

CRuntimeClass* pRuntimeClass = RUNTIME_CLASS( CMsacal70);
m_pCsCRCLD = (CMsacal70*)pRuntimeClass->CreateObject();

BOOL bResult = m_pCsCRCLD->CreateControl("MSACAL.MSACALCtrl.7",_T(""),WS_VISIBLE,MySize,this,m_nID);

if (bResult == FALSE)
{
      delete m_pCsCRCLD;
      AfxMessageBox("Control creation failed");
}


Is there anything else that needs to be done when an activex
control is being created inside of another activex control?
Can this be done?

Thanks in advance.
0
Comment
Question by:brisco
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 200 total points
Comment Utility
Look into the KB article

SAMPLE: Create an ActiveX Control with a Dialog Resource
http://support.microsoft.com/support/kb/articles/q155/9/73.asp
0
 

Author Comment

by:brisco
Comment Utility
This solution does work, but I have found that having the dialog created from a CWinThread prevents the control from sucessfully loading.  Not sure why.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now