News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Basic RichEdit questions

Started by NoCforMe, January 15, 2023, 12:16:40 PM

Previous topic - Next topic

NoCforMe

1. What happens if I load riched20.dll more than once? Asking because when I tried using my debugging tool, LogBuddy, on my editor, EdAsm, it totally messed up the font in the RichEdit control. One of the things the LogBuddy initialization routine does is load that library. (I had to use a RichEdit control in the logger because trying to use a regular edit control caused the whole thing to fail to create a window for some reason.)

2. If the answer is "bad things", is there some way to tell if this library is loaded without actually loading it?

Sub-question: should I maybe try using a different version of RichEdit? 20 is the one I found on my system (Windows 7). I really don't want to delve deeply into the treacherous Land Of Many Versions; what I'm using works fine for my application (an edit control used only with ANSI text).

Pretty sure I know who's qualified here to answer these questions ...
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on January 15, 2023, 12:16:40 PM
1. What happens if I load riched20.dll more than once?

Nothing serious, basically. But you can just check if the hLib handle is still zero.

Quote2. If the answer is "bad things", is there some way to tell if this library is loaded without actually loading it?

You can try to create a richedit control. If it fails, it was not loaded (if it succeeds, set a flag and delete it...)

QuoteSub-question: should I maybe try using a different version of RichEdit?

Micros*t recommends msftedit.dll, and that's what I am using now (after many years of %CommonProgramFiles%\Microsoft shared\Office1?\RichEd20.dll). It is definitely the fastest on Win7-64.

QuotePretty sure I know who's qualified here to answer these questions ...

More than one person, but all I will tell you is that our average age is 70 years :tongue:

NoCforMe

Quote from: jj2007 on January 15, 2023, 01:24:05 PM
Micros*t recommends msftedit.dll, and that's what I am using now (after many years of %CommonProgramFiles%\Microsoft shared\Office1?\RichEd20.dll). It is definitely the fastest on Win7-64.

What's the control class name for msftedit.dll? Is it still RichEdit20A?
Assembly language programming should be fun. That's why I do it.

jj2007

RichEdit50W - and attention, some messages require or deliver Utf16.

NoCforMe

#4
Thanks, will make a note of that.

But nevermind; it was an order-of-execution problem. IOW, a dumb mistake.

Still curious why an ordinary edit control failed me there.

Later: No longer curious; irritated. Rookie mistakes, like

EditClassname DB "edit", 0

-------------------------------
                              V
INVOKE CreateWindowExW,
0, ;EXstyles
OFFSET EditClassname,
NULL, ;window title/text
$editStyles, ;styles
$editXMargin, ;X-pos
EAX, ;Y-pos
gpRect.right, ;width
gpRect.bottom, ;height
BuddyWinHandle, ;parent
$editID, ;menu/ID
InstanceHandle,
0 ;param
MOV BuddyEditWinHandle, EAX


Notice that big ol' honkin' W there? Well, I didn't. Serves me right, trying to create a Unicode control with an ANSI class name ... aaaargh.
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on January 15, 2023, 02:03:27 PM
Later: No longer curious; irritated. Rookie mistakes, like

EditClassname DB "edit", 0

-------------------------------
                              V
INVOKE CreateWindowExW,

Welcome in the club, you are definitely not the first one who tried that :biggrin:

EditClassname _dw "edit", 0