?
Solved

ActiveX Control as a container

Posted on 1998-06-22
2
Medium Priority
?
273 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 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

770 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