Rich Edit DLL hell (long)

From: John Furlong (jfurlong_nospam_at_merlon.com)
Date: 11/05/03


Date: Wed, 5 Nov 2003 11:33:58 -0500

Hi all,

D7 Pro. Win 9x

The app. I am working on uses several TRichEdit components (for my sins),and
it requires use of the ITextDocument interface, which according to the MS
SDK is supported starting at V2.

On my XP development environment everything works as expected.

However, when QA tested on Win98 the application gets an exception on:

    Editor.Perform(EM_GETOLEINTERFACE, 0, lparam(@ole));
    doc := ole as ITextDocument;

The exception indicates that the interface is not supported.

This lead me to believe that V1 was being used on th Win98 machine.
I found RICHED32.DLL, and RICHED.DLL (16 bit?) installed, but not
RICHED20.DLL.

So, I installed the V3 version (RICHED20.DLL) - had to do this by installing
MS installer - what a crock!

Anyway, the problem did not go away.

So, I looked in ComCtrls at the TCustomRichEdit.CreateParams procedure which
explicitly loads the RICHED32.DLL (version 1) DLL and uses RICHEDIT as the
window class. This leads me to believe that it will ignore the fact that v2
or higher is available and always use V1.

As an aside, it is interesting to note that D7 is not supported on Win 95,
yet all other versions of Windows support at least V2, but D7 still uses V1.

I suspect that the app. works on XP because V1 is emulated and ITextDocument
is supported by the DLL.

So to my question (at last). How do I get TRichEdit to load V2?

TCustomRichEdit.CreateParams depends on a global variable FRichEditModule
declared in the implementation section of ComCtrls, and a local const
RichEditModuleName to define the DLL file name.

What I would like it to do is to try to load the possible DLLs in order of
MSFEDIT (v4.1) RICHED20 (V3 or V2) then RICHED32 (V1), and redistribute V3
RICHED20.DLL with my app.

The only way I seem to be able to do this is to create a modified version of
the ComCtrls.Pas source and compile it into my program, and distribute the
MS Windows Installer in order to install the correct version of
the DLL. This is extremely distasteful!

Does anyone have advice to offer,

If you reached this far, thanks for your patience.

John



Relevant Pages

  • Re: Freewrap question -- how to handle dlls
    ... > I'm using BLT on Windows, which doesn't support stubs. ... Use my installer to place my binary extensions in a fixed location ... Add the app directory to the auto_path variable like so: ... messy than what you would do in freewrap. ...
    (comp.lang.tcl)
  • RE: VS2005 setup project: execute tasks without installing files?
    ... Windows Installer SDK must be installed. ... Add it into Custom Action, in the Custom Action Editor, open its ... C++ custom action and we use it to get the dll path, ... Microsoft Online Community Support ...
    (microsoft.public.vsnet.setup)
  • RE: system.badimageformatexception returned from custom installer
    ... which references the dll that contains the custom installer code. ... Would you please provide more detailed information about your custom ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Re: DLL "Registration" in .NetCF?
    ... sometime during extended execution, or with another launch of the app later, ... > Do you perhaps have an identically named DLL elsewhere? ... >> just a matter of how the cab installer puts the dll file into /Windows, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Uninstall not removing dll
    ... uninstall methods are called but the dll where they live doesnt get removed ... This cant be because the installer cant remove the file because ... It would load the dll, run them, ... reason to reboot after uninstalling this app. ...
    (microsoft.public.dotnet.framework.setup)