🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10898

Dialog Boxes and child windows

#10898
From: Mark Morrisson
Date: Fri, 19 Mar 2004 18:39
40 lines
1930 bytes
Hi everyone,
Is it impossible to create a child window inside a dialog box ?
Well, I have created a dialog box through CreateDialog, and in
the WM_INITDIALOG message handler, I create a child window this
way :

hWndChart = CreateWindow("WndChart",
 "",
 WS_CHILD | WS_VISIBLE,
 100, 150,
 100, 30,
 hwnd,
 NULL,
 hInst,
 NULL);

where hwnd is the parameter passed to the dialog procedure, hInst
the gloval variable and "WndChart" a window class name registered
this way :

WNDCLASS wc;
wc.style = 0;
wc.lpfnWndProc = Chart_WndProc;  // The child window procedure
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hCursor = LoadCursor(0, IDC_CROSS);
wc.hbrBackground = (HBRUSH) CreateSolidBrush (PALETTERGB(255,128,128));
wc.lpszMenuName = 0;
wc.lpszClassName = "WndChart";
wc.hIcon = NULL;
RegisterClass(&wc);

The function RegisterClass returns true so the registration process
is successful. Though, hWndChart (returned by CreateWindow) is NULL.
A call to GetLastError returns the error 87 : invalid parameter.
What did I do wrong ?

Thanks in advance,
Mark
Technical Details
Message-ID: <405b3edd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f7c94584fd5860a5
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-19 11:10:57 PST
From: "Mark Morrisson" <mark4@NO_SPAMvoila.fr>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Dialog Boxes and child windows
Date: Fri, 19 Mar 2004 19:39:44 +0100
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 212.195.70.189
Message-ID: <405b3edd@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1079721693 212.195.70.189 (19 Mar 2004 10:41:33 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail