Hi.
I'm trying to create an MDI child window with as a RichEdit control, so =
i can type in it. The program compiled, but when I start it, it can't =
create child window. I guess the CreateWindowEx returns NULL when =
creating the child window, because I get the message box "could not =
create child window". What could cause this? Here's the piece of code:
case WM_CREATE:
{
char path[]=3D"c:\\winnt\\system32\\riched20.dll\0";
HMODULE hMod=3DLoadLibrary((LPCTSTR)&path);
if(hMod=3D=3DNULL)
MessageBox(hFrameWnd,"Could not load =
library","Error",MB_OK);
CLIENTCREATESTRUCT ccs;
ccs.hWindowMenu=3DGetSubMenu(GetMenu(hFrameWnd),1);
ccs.idFirstChild=3DID_FIRSTCHILD;
/*create client window*/
=
hMDIClient=3DCreateWindowEx(0,"MDICLIENT",(LPCTSTR)NULL,WS_CHILD|WS_CLIPC=
HILDREN,CW_USEDEFAULT,
=
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,hFrameWnd,(HMENU)ccs.idFirstChi=
ld,
g_hInstance,(LPVOID)&ccs);
ShowWindow(hMDIClient,SW_SHOW);
=20
/*create child window*/
=
hChildWnd=3DCreateWindowEx(WS_EX_CLIENTEDGE|WS_EX_MDICHILD,"RICHEDIT_CLAS=
S","Untitled",
=
WS_CHILD|ES_MULTILINE|ES_AUTOVSCROLL|WS_VISIBLE,CW_USEDEFAULT,CW_USEDEFAU=
LT,300,200,hMDIClient,
(HMENU)ccs.idFirstChild,g_hInstance,(LPVOID)lParam);
if(!hChildWnd)
MessageBox(hFrameWnd,"Could not create child =
wnd","Error",MB_OK);
ShowWindow(hChildWnd,SW_SHOW);
nChildCount=3D1;
}
break;
Regards,
Vlada
|