Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RICHED32.DLL, why?

135 views
Skip to first unread message

Frederic Larsen

unread,
Aug 21, 2005, 3:25:49 PM8/21/05
to

What is really annoying about Delphi is the fact that the TRichEdit component still uses RICHED32.DLL.
So, is there any quick way to update from RICHED32.DLL to RICHED20.DLL (v3.0 or v4.0) or Msftedit.dll?

I've added numbering support to my application, and after SaveTo/LoadFrom stream it should look like this:

Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
Line 6
Line 7

But this happens:

Loaded first time:

Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
4. Line 6
Line 7


Loaded second time:

Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
4. 4. Line 6
Line 7


Loaded third time:

Line 1
Line 2
1. Line 3
2. Line 4
3. Line 5
4. 4. 4. Line 6
Line 7


And so on...


And please, telling me how to remove this bug in RICHED32.DLL whould be nice, but, i really want a newer version of TRichEdit.

And... I don't want links to components, the componenet should be self-written or built into delphi.

Peter Below (TeamB)

unread,
Aug 22, 2005, 5:35:41 AM8/22/05
to
In article <4308d53d$1...@newsgroups.borland.com>, Frederic Larsen wrote:
> What is really annoying about Delphi is the fact that the TRichEdit component
> till uses RICHED32.DLL.
> So, is there any quick way to update from RICHED32.DLL to
> RICHED20.DLL (v3.0 or v4.0) or Msftedit.dll?

It is fairly simple to write a TRichedit descendent that loads Riched20.

unit pbRichEdit20;

interface

uses
SysUtils, Classes, Controls, StdCtrls, ComCtrls;

type
TPBRichEdit20 = class(TRichEdit)
protected
Procedure CreateParams( Var params: TCreateParams ); override;
end;

procedure Register;

implementation

uses windows, richedit;

procedure Register;
begin
RegisterComponents('PBGoodies', [TPBRichEdit20]);
end;

{ TPBRichEdit20 }

Var
FRichEditModule: THandle;

procedure TPBRichEdit20.CreateParams(var params: TCreateParams);
const
RichEditModuleName = 'RICHED20.DLL';
begin
if FRichEditModule = 0 then
begin
FRichEditModule := LoadLibrary(RichEditModuleName);
if FRichEditModule <= HINSTANCE_ERROR then FRichEditModule := 0;
end;
inherited CreateParams(Params);
CreateSubClass(Params, RICHEDIT_CLASS);
params.WindowClass.style := params.WindowClass.style and not (CS_HREDRAW or CS_VREDRAW);
end;

initialization
finalization
if FRichEditModule <> 0 then FreeLibrary(FRichEditModule);
end.

> And... I don't want links to components, the componenet should be self-written or
> built into delphi.

The above gives you a V2 or 3 richedit, but to access features not available in
V1 you need to use API methods (send messages to the control). A more complete
wrapper that exposes the new features as methods and properties can be found
in the JEDI VCL (see http://sourceforge.net/jvcl ). Comes with full source and is
free.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be


Frederic Larsen

unread,
Aug 24, 2005, 2:59:32 PM8/24/05
to

Exactly what i needed, thanks. The messages are ok, i just needed the abillity to use them.
0 new messages