Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Release, Debug, Doc/view and message Pin
PJ Arends1-Nov-06 14:11
professionalPJ Arends1-Nov-06 14:11 
QuestionStrange Console App Errors Pin
switang1-Nov-06 6:08
switang1-Nov-06 6:08 
AnswerRe: Strange Console App Errors Pin
Zac Howland1-Nov-06 7:00
Zac Howland1-Nov-06 7:00 
GeneralRe: Strange Console App Errors Pin
switang1-Nov-06 7:23
switang1-Nov-06 7:23 
GeneralRe: Strange Console App Errors Pin
Zac Howland1-Nov-06 7:45
Zac Howland1-Nov-06 7:45 
GeneralRe: Strange Console App Errors Pin
switang1-Nov-06 9:50
switang1-Nov-06 9:50 
QuestionHow do I generate tab shaped buttons? Pin
magstarinc1-Nov-06 5:33
magstarinc1-Nov-06 5:33 
QuestionActiveX controls child window of another ActiveX control Pin
Alton Williams1-Nov-06 4:45
Alton Williams1-Nov-06 4:45 

Hello all
Are you concerntating?
Yes, good. I am wondering it anyone knows the answer to
this topic or can point me in the right direction.


I'll elaborate upon my query. Thus any replies I get
(hopefully), will be answeredin the correct context.

Below are is a sample three controls.



  1. A standalone control (Demo control 1)
  2. Another standalone control (Demo control 2)

  3. A meta control which has its own features as well as
    containing controls (1 & 2 above)


When I build the first two, they both build and register successfully. I can
use either (or both) on other projects as child windows. i.e. VC dialogues, VB
forms, Delphi Forms. Web pages ect. with no problems.


There seems to be a problem when ActiveX control is a parent.

The nature of my
query is this:
how can achieve no3 (meta control) Without
it causing crashes when I insert it into other projects (or the test
container)

Step by
step to what I did to create number 3:

  • I've designed a control for called CMetaCtrrl via
    AppWizard
  • Inserted both Demo1 and Demo2 ActiveX controls into the project with their
    wrapper classes generated
  • Added a member 'variables' to both
  • Inserted the handler WM_CREATE (that's what you have to do if you're using
    child windows)
  • Inside the function OnCreate. I've added code to allow creation of the children windows
    CRect rcInit(CPoint(0), CPoint(0));
    m_demo1.CreateControl(m_demo1.GetClsid(), "", WS_CHILD | WS_VISIBLE,
        rcInit, this, 1001);
    m_demo2.CreateControl(m_demo2.GetClsid(), "", WS_CHILD | WS_VISIBLE,
        rcInit, this, 1002);
    

  • Added code to position and make Demo controls 1 &
    2 visible
  • Built the project (Which it does successfully) also
    favourably accomplished is the registration of the control.

That done I test newly created control. It's when I insert that's when the
troubles start. When using the test container it raises an execption, or on
placement of the control on a form (or dialogue) the same things happens.
In addition to that it brings down whatever development tool I'm using. The
problem is occurring when an attempt is made to create the first chold
window.


On debugging I've stepped into m_demo1.CreateControl().

Which leads me to step into

AFX_MODULE_STATE* AFXAPI <br />
AfxGetModuleState()
the module state is not a NULL pointer.

I then went to probe into
CMetaCtrl::InitControlContainer() (BOOL CWnd::InitControlContainer()). The issue
behind it is coming from the fourth line of the snippet
(m_pCtrlCont = <br />
afxOccManager->CreateContainer(this); ) 
Confused | :confused: Confused | :confused:

<CODE>
	TRY
	{
		if (m_pCtrlCont == NULL)
			m_pCtrlCont = afxOccManager->CreateContainer(this);
	}
	END_TRY

</CODE>
I fail to understand why this is happening. I know how to place
common controls a child on an ActiveX control. I would like to know how to
create and place an ActiveX child and have another as it's parent. Surely, there must be a way
of doing this. I'm sorry this is so verbose, I had to explain it such
a way that I will get my question in it's correct context.
Many Thanks Alton

AnswerRe: ActiveX controls child window of another ActiveX control Pin
TClarke1-Nov-06 5:07
TClarke1-Nov-06 5:07 
GeneralRe: ActiveX controls child window of another ActiveX control Pin
Alton Williams9-Nov-06 11:29
Alton Williams9-Nov-06 11:29 
GeneralRe: ActiveX controls child window of another ActiveX control Pin
TClarke9-Nov-06 23:06
TClarke9-Nov-06 23:06 
QuestionCombobox problems Pin
ceejeeb1-Nov-06 4:21
ceejeeb1-Nov-06 4:21 
QuestionRe: Combobox problems Pin
David Crow1-Nov-06 4:38
David Crow1-Nov-06 4:38 
AnswerRe: Combobox problems Pin
Maximilien1-Nov-06 5:08
Maximilien1-Nov-06 5:08 
GeneralRe: Combobox problems Pin
David Crow1-Nov-06 5:29
David Crow1-Nov-06 5:29 
AnswerRe: Combobox problems Pin
Hamid_RT1-Nov-06 5:22
Hamid_RT1-Nov-06 5:22 
QuestionDisconnect data exchange Pin
Wim Engberts1-Nov-06 3:56
Wim Engberts1-Nov-06 3:56 
AnswerRe: Disconnect data exchange Pin
David Crow1-Nov-06 4:39
David Crow1-Nov-06 4:39 
GeneralRe: Disconnect data exchange Pin
Wim Engberts1-Nov-06 5:04
Wim Engberts1-Nov-06 5:04 
GeneralRe: Disconnect data exchange Pin
David Crow1-Nov-06 5:32
David Crow1-Nov-06 5:32 
QuestionGetThreadId - kernel32.dll Pin
edvintas1-Nov-06 3:48
edvintas1-Nov-06 3:48 
AnswerRe: GetThreadId - kernel32.dll Pin
Chris Meech1-Nov-06 4:29
Chris Meech1-Nov-06 4:29 
GeneralRe: GetThreadId - kernel32.dll Pin
edvintas1-Nov-06 4:39
edvintas1-Nov-06 4:39 
GeneralRe: GetThreadId - kernel32.dll Pin
Chris Meech1-Nov-06 5:16
Chris Meech1-Nov-06 5:16 
GeneralRe: GetThreadId - kernel32.dll Pin
edvintas1-Nov-06 6:21
edvintas1-Nov-06 6:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.