News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

include files for richedit 4.1 ( Msftedit.dll )

Started by zemtex, November 14, 2011, 12:14:25 AM

Previous topic - Next topic

zemtex

I can't seem to find include files for richedit 4.1, unfortunately earlier versions of richedit lacks some features that I need to use so I cannot backstep. In perticular, I cannot find MSFTEDIT_CLASS in any include files, it is the basic window type specifier for creating a richedit. You normally use RICHEDIT_CLASS for earlier versions.

Any advice?
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

dedndave

the C string definitions don't translate directly to ASM   :P
you have to use something like this

szRichEditClass db 'RICHEDIT50W',0

the class is still pre-defined (system registered class) - you just need a string

zemtex

I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

dedndave

 :bg

you have to do the same thing if you want to use CreateWindowEx to make scroll bars, status bars, or other system-defined controls

zemtex

I was so into the ms docs I confused the string for a constant, I know you have to pass the strings when you create controls, I just had my head full in the richedit docs. VERY full. Sometimes you just forget irrelevant details for no apparent reason. Do you know what I mean? A good example is if you read a whole day on some technical stuff, all the suddenly you don't know how to quit windows, you forgot that you have to use the windows button to find the quit button, that is how full my head is today.  :bdg
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

jj2007

Have a look at MasmBasic's RichMasm editor. I tried my luck with Msftedit.dll, but there is a reason why it never got popular. RichEd20.dll from Office 11 is the best compromise for stability and features.

Here is a snippet showing how the version to be used is determined:
mov esi, offset LibNameOffice
invoke LoadLibrary, esi ; user-copied \masm32\RichMasm\Dll\RichEditOffice.DLL
.if !eax
mov esi, RichEditV$ ; dest buffer
invoke ExpandEnvironmentStrings, chr$("%CommonProgramFiles%"), esi, MAX_PATH
mov ebx, eax
invoke lstrcat, esi, chr$("\Microsoft Shared\OFFICE11\RichEd20.DLL")
invoke LoadLibrary, esi ; RichEd20.dll, Office 11 version
.if !eax
mov byte ptr [esi+ebx+24], "2" ; convert Office11 to Office12
invoke LoadLibrary, esi ; RichEd20.dll, Office 12 version
.if !eax
mov esi, offset LibName
invoke LoadLibrary, esi ; RichEd20.dll for poor people
.endif
.endif
.endif
mov RichEditUsed, esi

dedndave

Quotethat is how full my head is today

i know just what you mean
at my age, if i want to learn something new, i hafta push some old stuff out - lol
i am good as long as i remember Zara's birthday, Jade's birthday, and our anniversary   :U

dedndave

JJ
i have no richedit dll in my office11 folder, but i do have one in an office12 folder
office11 only has msxml5.dll

in office12, i have...
     MSO.DLL  16,870,712
msoshext.dll     932,688
  MSPTLS.DLL     757,008
     OGL.DLL   1,658,152
RICHED20.DLL   1,082,144

they are all dated 10/27/2006

jj2007

#8
Quote from: dedndave on November 14, 2011, 01:34:28 AM
JJ
i have no richedit dll in my office11 folder, but i do have one in an office12 folder
office11 only has msxml5.dll

That's odd. I have these:
QuoteC:\WINDOWS\system32\riched20.dll - 433,152 bytes, 27.11.2006

QuoteC:\Programmi\File comuni\Microsoft Shared\OFFICE11\msxml5.dll
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\MSO.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\RICHED20.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\UCS20.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\MSSH.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\MSMH.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\MSOXEV.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\MSOXMLMF.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\USP10.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\MSSOAP30.DLL
C:\Programmi\File comuni\Microsoft Shared\OFFICE11\WISC30.DLL
dated ??.??.2003.

On another PC, I have
QuoteC:\Program Files\Common Files\Microsoft Shared\OFFICE11\RICHED20.DLL
dated 20.09.2004, 965,400 bytes.
QuoteC:\Program Files\Common Files\Microsoft Shared\OFFICE12\RICHED20.DLL
dated 27.10.2006, 1,082,144 bytes.

The System32 version is younger than the Office11 version, but important features (tables) are crippled.

The Office12 version requires MSPTLS.DLL in the PATH, and is slower than the older Office11 file. For example, loading the RichMasm source takes (P4, Win XP)...
6.5 seconds with System32\RICHED20.DLL
2.0 seconds with Office12\RICHED20.DLL
0.7 seconds with Office11\RICHED20.DLL
... i.e. the performance differences are not negligible.

Which loaded version does RichMasm show when you press F8?

ToutEnMasm

Quote
I can't seem to find include files for richedit 4.1,
???????????????????????????????????????????????????????????????????????????
http://www.masm32.com/board/index.php?topic=8542.0
Quote
richedit.sdk

MSFTEDIT_CLASS   equ   <"RICHEDIT50W">
; NOTE:  MSFTEDIT.DLL only registers MSFTEDIT_CLASS.  If an application wants
; to use the following Richedit classes, it needs to load the riched20.dll.
; Otherwise, CreateWindow with RICHEDIT_CLASS would fail.
; This also applies to any dialog that uses RICHEDIT_CLASS,
; RichEdit 2.0 Window Class
; On Windows CE, avoid possible conflicts on Win95
CERICHEDIT_CLASSA   equ   <"RichEditCEA">
CERICHEDIT_CLASSW   equ   <"RichEditCEW">
RICHEDIT_CLASSA   equ   <"RichEdit20A">
RICHEDIT_CLASS10A   equ   <"RICHEDIT">
IFNDEF MACPORT
RICHEDIT_CLASSW   equ   <"RichEdit20W">
ELSE
RICHEDIT_CLASSW   equ   <"RichEdit20W">
ENDIF ; MACPORT 
IF ( _RICHEDIT_VER GE 00200h)
IFDEF UNICODE
RICHEDIT_CLASS   equ   < RICHEDIT_CLASSW>
ELSE
RICHEDIT_CLASS   equ   < RICHEDIT_CLASSA>
ENDIF ; UNICODE
ELSE
RICHEDIT_CLASS   equ   < RICHEDIT_CLASS10A>
ENDIF ; _RICHEDIT_VER >= 0x0200
; RichEdit messages


jj2007

QuoteIFDEF UNICODE
RICHEDIT_CLASS   equ   < RICHEDIT_CLASSW>

The "Ansi" versions handle Unicode just fine. No need to fumble with WSTR etc...

ToutEnMasm

Quote
The "Ansi" versions handle Unicode just fine. No need to fumble with WSTR etc...
Rewrite the windows sdk,it would be easy to do with ....  :bg


dedndave

MSFTEDIT_CLASS   equ   <"RICHEDIT50W">

that is an attempt to assign a C string to a MASM constant
i am afraid that won't fly, Yves   :P

you might do something like this
__szMSFTEDIT_CLASS db "RICHEDIT50W",0
MSFTEDIT_CLASS     equ <offset __szMSFTEDIT_CLASS>

dedndave

Jochen,
here is my F8 report in RichMasm...
---------------------------
RichMasm
---------------------------
Loading RichMasmGuide.asc took 0.47 seconds

RichEdit version: C:\Program Files\Common Files\Microsoft Shared\OFFICE12\RICHED20.DLL
---------------------------
OK   
---------------------------


jj2007

Thanks, Dave. Since we have the same P4, our results should be comparable: with the Office11 dll, it takes 0.19 seconds.