Re: Problem dynamically creating Custom Controls
- From: "altja" <Joseph.Alt@xxxxxxxxxxx>
- Date: 21 Sep 2006 11:55:44 -0700
Ajay Kalra wrote:
I want to create a custom control dynamically that displays a row with
4 controls for 0 to N number of drawings that I will only know only at
runtime.
My problem is that in the Parent Dialog the create function always
returns 0 and then never displays. Per MSDN I expect a Return Value =
Nonzero if successful; otherwise 0. Hence, I am failing every time.
Note, I am ably to display my custom control properly if I place it at
design time, but that will not work.
The control needs to be created after dialog has been created. That
means you cant create these in Dialog's constructor. Do it in
OnInitDialog after calling the base class's OnInitDialog.
---
Ajay
I believe this is what I am already doing.
Parent Dialog
BOOL ReviewDialog::OnInitDialog()
{
CDialog::OnInitDialog(); //Create Dialog
BOOL bcreate;
//Create Control
bcreate = m_testRow.Create(MYWNDCLASS,NULL, WS_CHILD | WS_VISIBLE
,CRect(0, 500, 180, 600),this,1);//Returns unsuccesful 0 every time.
.
- Follow-Ups:
- Re: Problem dynamically creating Custom Controls
- From: Ajay Kalra
- Re: Problem dynamically creating Custom Controls
- References:
- Problem dynamically creating Custom Controls
- From: altja
- Re: Problem dynamically creating Custom Controls
- From: Ajay Kalra
- Problem dynamically creating Custom Controls
- Prev by Date: WM_SYSCOMMAND & SC_RESTORE will not restore the window
- Next by Date: Re: Problem dynamically creating Custom Controls
- Previous by thread: Re: Problem dynamically creating Custom Controls
- Next by thread: Re: Problem dynamically creating Custom Controls
- Index(es):
Relevant Pages
|