Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ActiveX Control as a container

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 …
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

610 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