RE: [GD-Windows] CreateDialog failure
Brought to you by:
vexxed72
From: Brian S. <bs...@mi...> - 2002-08-24 17:06:19
|
I mostly use MFC for these sorts of things but here are some ideas to = try: * are you sure hInstance is the instance handle to your dll and not the = app? otherwise LoadResource on the dialog resource will fail * is hWnd a fully created window, or is it one you're in the process of = creating? have you tried passing NULL for the parent? * Is NULL a valid value for the DialogProc? Should it be DefDlgProc? * If you replace your call with MessageBox(...) does everything work? Unfortunately I do not know the answer to your real problem, but here's = a timesaving tip: typing "err,hr" into a watch window in the debugger = saves you the hassle of calling GLE/FormatMessage/etc. --brian -----Original Message----- From: Pierre Terdiman [mailto:p.t...@wa...] Sent: Sat 8/24/2002 7:18 AM To: gam...@li... Cc:=09 Subject: [GD-Windows] CreateDialog failure Hi, I create a dialog using something like : handle =3D CreateDialog( hInstance, MAKEINTRESOURCE(IDD_DIALOG1), hWnd, NULL); But returned handle is null, which means (I guess) something went wrong. So I tried : DWORD Er =3D GetLastError(); Then retrieving the error string using FormatMessage (using the code = snippet from the MSDN). But it doesn't help since error code is 0 and = the translated string says there was no error. Hmm. What do I do now ? What are the usual reasons for CreateDialog to fail ? In case it's important, the call takes place in a DLL dynamically loaded = by a 3DS MAX plug-in, and hInstance and hWnd used to create the dialog = are the ones from the MAX plug. Pierre |