-
July 9th, 2011, 03:34 PM
#1
[RESOLVED] SendMessage fails with WM_MDICREATE
Hi all:
I've been debugging with my MDI app for one bug:
Code:
MDICREATESTRUCT mcs;
HWND hChild;
mcs.szTitle = L"[Untitled]";
mcs.szClass = MDI_CHILD_WND_NAME;
mcs.hOwner = GetModuleHandle(NULL);
mcs.x = mcs.cx = CW_USEDEFAULT;
mcs.y = mcs.cy = CW_USEDEFAULT;
mcs.style = MDIS_ALLCHILDSTYLES;
hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LONG)&mcs);
if(hChild == NULL)
{
MessageBox(hMDIClient, L"Failed to create MDI Child", L"Error",
MB_ICONEXCLAMATION | MB_OK);
}
The MDI client window shows up correctly. I've also double checked hMDIClient is having the correct value, i.e. it is indeed the handle to the MDI client window. But why does it always fail to create MDI child window?
I'm stuck on this single issue for more than 20 hours. Please help if you can!
Thanks.
-
July 10th, 2011, 09:21 AM
#2
Re: SendMessage fails with WM_MDICREATE
You could try CreateMDIWindow and if it fails, call GetLastError() and look at the system error codes.
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
July 11th, 2011, 08:07 AM
#3
Re: SendMessage fails with WM_MDICREATE
Thanks for the reply.
I've got it sorted out. It was due to a silly mistake of mine in another place of the code.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|