Solved

ActiveX Control as a container

Posted on 1998-06-22
2
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 200 total points
ID: 1318288
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
ID: 1318289
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Macro to save highlighted rows as a separate file 5 46
how to monitor remote shell execution on linux 9 106
MaxSpan challenge 9 123
Problem to App source 6 89
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

735 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