In a program that uses Dialog box as main windows , I was trying to load
a RichTextBox control:





.if eax==WM_INITDIALOG
push hWin
pop hWnd

invoke CreateWindowEx,WS_EX_CLIENTEDGE,addr RichEditClass,0,WS_CHILD or WS_VISIBLE or ES_MULTILINE or WS_VSCROLL or WS_HSCROLL or ES_NOHIDESEL,\
CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,hWnd,RichEditID,hInstance,0
mov hwndRichEdit,eax



and of course in the beginning of the code:




;loading the RichEdit's DLL librarry:
invoke LoadLibrary,addr RichEditDLL
.if eax!=0
mov hRichEdit,eax
;start the program normally:
invoke GetCommandLine
invoke InitCommonControls
mov CommandLine,eax
invoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT

invoke FreeLibrary,hRichEdit
.else
;invoke MessageBox,0,addr NoRichEdit,addr AppName,MB_OK or MB_ICONERROR
.endif
;exit on error.



When I run the program , I can see everything except for the RichTextBox control.
Am I doing something wrong?

bar.
Posted on 2004-10-02 09:25:24 by realcr
If you want to see a separate control, you should give it a specific dimension and location instead of CW_USEDEFAULT.

If your main window had been a regular window instead of a dialog box, the CW_USEDEFAULT would have caused the entire client area to become the RichTextBox control and would not have looked any different than the client area of a regular window.

Raymond
Posted on 2004-10-02 19:17:41 by Raymond
tnx Raymond.

bar.
Posted on 2004-10-02 19:29:05 by realcr