I'm re'ing my own post, but I think there's a combination of (1) a wine bug and (2) user error at work here.
(1) The wine bug (I think) is that riched32.dll is registering the wrong window class name. Here's a suggested patch:
[root@ihop dlls]# diff -Naur richedit/richedit.c richedit.MUSE/richedit.c --- richedit/richedit.c 2004-11-18 12:28:53.000000000 -0800 +++ richedit.MUSE/richedit.c 2004-11-18 17:03:33.000000000 -0800 @@ -792,7 +792,11 @@ wndClass.cbWndExtra = RTFInfoOffset + sizeof(RTFControl_Info*); wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); +#if (_RICHEDIT_VER >= 0x0200 ) + wndClass.lpszClassName = RICHEDIT_CLASS20A; /* WC_RICHED32A; */ +#else wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */ +#endif
RegisterClassA (&wndClass); }
Can any wise ones comment on this?
(2) My user error is that Windows requires that RICHED32.DLL be manually loaded before use, it seems. At least that's what MFC requires, via its AfxInitRichEdit2() function. I called LoadLibrary("RICHED32.DLL") and, with my above patch, CreateWindow(RICHEDIT_CLASS,...) works fine.
This isn't true for other DLLs... but, oh well, there it is.
Cheers... mo
Michael Ost wrote:
(1) The wine bug (I think) is that riched32.dll is registering the wrong window class name. Here's a suggested patch:
RICHEDIT_CLASS20A is provided by riched20.dll, not riched32.dll. The windows 2000 implementation uses riched20.dll to implement riched32.dll (ie. moves the richedit code to riched20.dll and implements the RICHEDIT_CLASS10A class using the new RICHEDIT_CLASS20A class.
In short, the existing code registers the correct class name, but we need to make a new dll dlls/riched20, and do alot of work on the richedit control :)
Actually, since we need to work on riched20, we might as will implement that properly, rather than trying to reuse the edit control.
Mike
On Fri, 2004-11-19 at 03:22, Mike McCormack wrote:
Michael Ost wrote:
(1) The wine bug (I think) is that riched32.dll is registering the wrong window class name. Here's a suggested patch:
RICHEDIT_CLASS20A is provided by riched20.dll, not riched32.dll. The windows 2000 implementation uses riched20.dll to implement riched32.dll (ie. moves the richedit code to riched20.dll and implements the RICHEDIT_CLASS10A class using the new RICHEDIT_CLASS20A class.
In short, the existing code registers the correct class name, but we need to make a new dll dlls/riched20, and do alot of work on the richedit control :)
This isn't quite clear to me. It sounds like you are saying there is a riched20.dll in wine, but I can't find one. Are these statements correct?
* Wine's only implements RichEdit10A via riched32.dll. Wine does not implement RichEdit20A.
* Win2K (and later) provides riched20.dll which implements RICHEDIT_CLASS20A. This one I can verify as true on my winxp system.
* There are significant differences between the two window classes
My winelib app is hosting a 3rd party DLL which is specifically requesting "RichEdit20A". That suggests that the DLL was built with win2K or later, from what you were saying. Sounds like my options are to:
* hack their request to use the window class registered by wine's riched32.dll. How well could I expect this to work? How big are the diffs between 10A and 20A?
* get them to provide win2k's riched20.dll
* have them change their DLL to ask for RichEdit10A instead
* implement riched20.dll in Wine. Sounds like a big job!
Sound right? Any comments? Thanks a bunch... mo
--- Michael Ost most@museresearch.com wrote:
On Fri, 2004-11-19 at 03:22, Mike McCormack wrote:
Michael Ost wrote:
(1) The wine bug (I think) is that riched32.dll is registering the wrong window class name. Here's a suggested patch:
RICHEDIT_CLASS20A is provided by riched20.dll, not riched32.dll. The windows 2000 implementation uses riched20.dll to implement riched32.dll (ie. moves the richedit code to riched20.dll and implements the RICHEDIT_CLASS10A class using the new RICHEDIT_CLASS20A class.
In short, the existing code registers the correct class name, but we need to make a new dll dlls/riched20, and do alot of work on the richedit control :)
This isn't quite clear to me. It sounds like you are saying there is a riched20.dll in wine, but I can't find one. Are these statements correct?
He's saying that "riched32.dll in wine registers the correct class name, which is RICHEDIT_CLASS10A. To implement RICHEDIT_CLASS20A, we need to make another dll, that is, riched20.dll"
- Wine's only implements RichEdit10A via riched32.dll. Wine does not
implement RichEdit20A.
- Win2K (and later) provides riched20.dll which implements
RICHEDIT_CLASS20A. This one I can verify as true on my winxp system.
- There are significant differences between the two window classes
I think all 3 statements are correct.
My winelib app is hosting a 3rd party DLL which is specifically requesting "RichEdit20A". That suggests that the DLL was built with win2K or later, from what you were saying. Sounds like my options are to:
- hack their request to use the window class registered by wine's
riched32.dll. How well could I expect this to work? How big are the diffs between 10A and 20A?
get them to provide win2k's riched20.dll
have them change their DLL to ask for RichEdit10A instead
implement riched20.dll in Wine. Sounds like a big job!
Sound right? Any comments? Thanks a bunch... mo
Last option is the best :)
__________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com
Hi Michael,
This isn't quite clear to me. It sounds like you are saying there is a riched20.dll in wine, but I can't find one.
No, there's no riched20.dll implementation in Wine as yet.
Are these statements correct?
- Wine's only implements RichEdit10A via riched32.dll. Wine does not
implement RichEdit20A.
Right.
- Win2K (and later) provides riched20.dll which implements
RICHEDIT_CLASS20A. This one I can verify as true on my winxp system.
Right.
- There are significant differences between the two window classes
RICHEDIT_CLASS20A extends RichEdit10A ... so it supercedes it.
My winelib app is hosting a 3rd party DLL which is specifically requesting "RichEdit20A". That suggests that the DLL was built with win2K or later, from what you were saying. Sounds like my options are to:
- hack their request to use the window class registered by wine's
riched32.dll. How well could I expect this to work? How big are the diffs between 10A and 20A?
I think that would probably work.
- get them to provide win2k's riched20.dll
My preference is always to fix Wine...
- have them change their DLL to ask for RichEdit10A instead
Yes, that would work.
- implement riched20.dll in Wine. Sounds like a big job!
Yes, it's a big job, but once the correct skeleton is in place, people will extend it.
Sound right? Any comments? Thanks a bunch... mo
We have an empty implementation of riched20 that simply forwards requests to edit. That is the wrong, and the existing riched32 code is broken too (since it uses the edit control).
CrossOver's riched20 code is attached... it's a quick and easy way to fix the problem, but the correct, longterm solution for Wine is to implement riched20.dll properly and then forward requests from riched32 to riched20 rather than the edit control, which is why this code is not in WineHQ.
It depends how nice you want it to look...
Mike
which is why this code is not in WineHQ.
What is it exactly that is keeping this code out of wine? Just curious because if it's something that just needs to be worked on, we should let developers know so we can get started on that.
On Sat, 20 Nov 2004 10:16:39 +0900, Mike McCormack mike@codeweavers.com wrote:
Hi Michael,
This isn't quite clear to me. It sounds like you are saying there is a riched20.dll in wine, but I can't find one.
No, there's no riched20.dll implementation in Wine as yet.
Are these statements correct?
- Wine's only implements RichEdit10A via riched32.dll. Wine does not
implement RichEdit20A.
Right.
- Win2K (and later) provides riched20.dll which implements
RICHEDIT_CLASS20A. This one I can verify as true on my winxp system.
Right.
- There are significant differences between the two window classes
RICHEDIT_CLASS20A extends RichEdit10A ... so it supercedes it.
My winelib app is hosting a 3rd party DLL which is specifically requesting "RichEdit20A". That suggests that the DLL was built with win2K or later, from what you were saying. Sounds like my options are to:
- hack their request to use the window class registered by wine's
riched32.dll. How well could I expect this to work? How big are the diffs between 10A and 20A?
I think that would probably work.
- get them to provide win2k's riched20.dll
My preference is always to fix Wine...
- have them change their DLL to ask for RichEdit10A instead
Yes, that would work.
- implement riched20.dll in Wine. Sounds like a big job!
Yes, it's a big job, but once the correct skeleton is in place, people will extend it.
Sound right? Any comments? Thanks a bunch... mo
We have an empty implementation of riched20 that simply forwards requests to edit. That is the wrong, and the existing riched32 code is broken too (since it uses the edit control).
CrossOver's riched20 code is attached... it's a quick and easy way to fix the problem, but the correct, longterm solution for Wine is to implement riched20.dll properly and then forward requests from riched32 to riched20 rather than the edit control, which is why this code is not in WineHQ.
It depends how nice you want it to look...
Mike
James Hawkins wrote:
which is why this code is not in WineHQ.
What is it exactly that is keeping this code out of wine? Just curious because if it's something that just needs to be worked on, we should let developers know so we can get started on that.
Like most things that are in CrossOver, but not in Wine, it is a hack that are encourages working around the problem rather than fixing the cause of the problem. The solution is to start work on a skeleton control, perhaps that just has some basic drawing functionality and not much else. Then gradually extend it to become the mini word processor it actually is.
Rob
James Hawkins wrote:
which is why this code is not in WineHQ.
What is it exactly that is keeping this code out of wine? Just curious because if it's something that just needs to be worked on, we should let developers know so we can get started on that.
The current riched32 is wrong. It should not be based on the edit control. While it is, no incremental improvement is possible. The code I sent in the previous mail is not going in to WineHQ any time soon, so that somebody will have motivation to fix Richedit 2.0 properly, which is the path forward for Richedit 1.0 also.
Mike
I just want to make sure I've got this right. So we need to implement riched20, and then forward requests from riched32 to riched20 because riched20 supercedes riched32?
On Sat, 20 Nov 2004 11:46:12 +0900, Mike McCormack mike@codeweavers.com wrote:
James Hawkins wrote:
which is why this code is not in WineHQ.
What is it exactly that is keeping this code out of wine? Just curious because if it's something that just needs to be worked on, we should let developers know so we can get started on that.
The current riched32 is wrong. It should not be based on the edit control. While it is, no incremental improvement is possible. The code I sent in the previous mail is not going in to WineHQ any time soon, so that somebody will have motivation to fix Richedit 2.0 properly, which is the path forward for Richedit 1.0 also.
Mike
James Hawkins wrote:
I just want to make sure I've got this right. So we need to implement riched20, and then forward requests from riched32 to riched20 because riched20 supercedes riched32?
Right. The current implementation of riched32 is Wrong(tm).
We'll implement riched20 from scratch and do it the right way. When it's good enough, we can then rewrite riched32 to use the riched20 control instead of the edit control.
All that can be done in small incremental improvements, which is the key to making cooperative development work.
Mike