Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does CreateDialogParam require an owner dialog?

104 views
Skip to first unread message

T

unread,
May 24, 2012, 4:03:53 PM5/24/12
to
I want to create a dialog (property page template) that has no parent window. Is this not possible with CreateDialog? I get an error indicating "Cannot create a top-level child window." (ERROR_TLW_WITH_WSCHILD = 1406)

Is it specified in the property somewhere that the window I create is a child window? If some, where can I change it?

HWND window = ::CreateDialogParam(::GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PROPPAGE_SMALL), NULL, NULL, 0);

Uwe Kotyczka

unread,
May 29, 2012, 10:18:11 AM5/29/12
to
On 24 Mai, 22:03, T <mstin...@gmail.com> wrote:
> HWND window = ::CreateDialogParam(::GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PROPPAGE_SMALL), NULL, NULL, 0);

The fourth parameter (DLGPROC lpDialogFunc) must not be NULL.
Provide a pointer to your own dialog box procedure

BOOL CALLBACK YourDialogProc(
HWND hwndDlg, // handle to dialog box
UINT uMsg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);

instead. HTH
0 new messages