CommDlg seems to richedit control stuck...??? Help needed

Started by xandaz, January 20, 2011, 06:58:01 PM

Previous topic - Next topic

xandaz

   Hi there. The richedit control gets stuck. On entry it should stream a file in, but does nothing. Also it doesnt accept and jeyboard input. Can someone help me out?

jj2007

The *.bmp files are missing in your archive. Same for xpmanifest.xml

xandaz

    Sorry about that. Here's all. Thanks jj and laters.

MichaelW

The problem with the rich edit not accepting keyboard input is here:

invoke  SendMessage,hRichEdit,WM_SETTEXT,NULL,addr NullString

And after I commented the above statement, the stream-in worked.

Also, although I doubt that this is creating problems, you are loading the rich edit DLL twice.


eschew obfuscation

xandaz

   Yes.... welll.... the program is half way done. The problem was the hMenu in CREATEPARAMS of the richedit control. I don't think i can explain this behaviour but if someone can please do. I would this parameter would be so important with the mentioning of comdlg32 includes and not without it.... i think it has some importance. So, if someone knows....
   Michael... the prog doesn't accept any input on startup, that is, before any WM_COMMAND msg. How could that be the problem? All that that does is clear the Edit control. Thanks a lot everyone.

MichaelW

Quote from: xandaz on January 21, 2011, 12:40:45 AM
Michael... the prog doesn't accept any input on startup, that is, before any WM_COMMAND msg. How could that be the problem? All that that does is clear the Edit control.

If I comment it out, the program does accept input on startup. And WM_COMMAND is being sent, three times before I do anything in the application window. Here are the wParam and lParam values in hex:

04000000        000E041A
04000000        000E041A
04000000        000E041A

The notification code is EN_UPDATE and the handle is that of the rich edit control.

Also, I found another error in EditProc:

invoke  SendMessage,hRichEdit,EM_GETSEL,SelFirst,SelLast

Should be:

invoke  SendMessage,hRichEdit,EM_GETSEL, ADDR SelFirst, ADDR SelLast

And I tried skipping the subclass of the rich edit control, by commenting:

invoke  SetWindowLong,hRichEdit,GWL_WNDPROC,addr EditProc

And that did not solve the problem.


eschew obfuscation

xandaz

   Damn.... well.... i have no reason to doubt that. For it seems just a bit beyond me. Let me see what i can do.
   Right... There's the EN_UPDATE message. If i process it no problem at all. Thanks....
   EN_UPDATE probabilly has no LOWWORD wParam so it sends the WM_SETTEXT ,null String. I guess i just have to learn more about this, thanks for the help.

xandaz

   hey... about EM_GETSEL.... i thought that because it wasn't a stringable pointer it wouldnt make a difference to reffer addr. But i just tried it out and it makes a difference. Thanks again. Bye
   ( he goes a away with the tail between his legs ) :)

jj2007

Try this in your WM_COMMAND handler:
            invoke  SendMessage,hRichEdit,WM_SETTEXT,NULL, chr$("Bad luck")

WM_COMMAND is being sent when you click into the control, so every time you try to insert text, it is being cleared immediately. If you want to clear the window, do it just before streaming in.

xandaz

   Right jj. You're right. It's the en_selchange. I've only process WM_COMMAND .if HIWORD eax!=EN_UPDATE || EN_SELCHANGE. It seems to be working fine. Thanks a lot guys. :bg :bg

xandaz

   Hey... i'm making this richedit thingy but have a problem streaming out when  user chooses to open a file. Can someone look into it?

jj2007


xandaz

   Try to enter text in the edit control and open another file. It should save the chngess so when you reopen the file you get the file with changes. Thank

jj2007

It does save changes, but it seems you have other issues. And I still have no clue what that settext null$ message is good for.

xandaz

   Just clears the window. This thing is less than half way done. How'd you clear the richedit control? Shouldnt i use an empty string? Thanks and bye