Rich Edit version | DLL | Window Class |
1.0 | |Riched32.dll| | RICHEDIT |
2.0 | |Riched20.dll| | RICHEDIT20A |
3.0 | |Riched20.dll| | RICHEDIT20A |
4.1 | Msftedit.dll | RichEdit50W |
Quote from: Mikl__ on May 29, 2019, 09:17:30 PM
The original specification for rich edit controls is Microsoft Rich Edit 1.0; the current specification is Microsoft Rich Edit 4.1. Each version of rich edit is a superset of the preceding one, except that only Asian builds of Microsoft Rich Edit 1.0 have a vertical text option. Before creating a rich edit control, you should call the LoadLibrary function to verify which version of Microsoft Rich Edit is installed.
The following table shows which DLL corresponds with which version of Rich Edit. Note that the name of the file did not change from version 2.0 to version 3.0. This allows version 2.0 to be upgraded to version 3.0 without breaking existing code.Does anyone have any examples on how to use Msftedit.dll? Thank you.
Rich Edit version DLLWindow Class 1.0Riched32.dll RICHEDIT 2.0Riched20.dll RICHEDIT20A 3.0Riched20.dll RICHEDIT20A 4.1Msftedit.dll MSFTEDIT_CLASS
invoke LoadLibrary, chr$("msftedit")
invoke CreateWindowEx, WS_EX_CLIENTEDGE, chr$("RichEdit50W"), NULL,
WS_CHILD or WS_VISIBLE or WS_BORDER or WS_VSCROLL or ES_MULTILINE,
9, 9, 500, 200, hWnd, 103, wcx.hInstance, NULL ; we have added an edit control
mov hEdit, eax
Quote from: LiaoMi on May 29, 2019, 09:57:58 PMhttp://masm32.com/board/index.php?topic=5383.0 (http://masm32.com/board/index.php?topic=5383.0)
Quote from: Vortex on May 30, 2019, 03:52:55 AM
Another source :
https://www.filehorse.com/download-word-viewer/
Quote from: jj2007 on May 30, 2019, 06:04:18 AMQuote from: Vortex on May 30, 2019, 03:52:55 AM
Another source :
https://www.filehorse.com/download-word-viewer/
Interesting, Erol. To the left, the filehorse version, to the right the one that I have been using until now. After installing the WordViewer, they are in C:\Program Files (x86)\Common Files\microsoft shared\OFFICE11\RICHED20.DLL
0032 0016BE50 0025C6C9 ConvertEquationFromOleStream
0033 0016C2F0 0025C6E6 ConvertEquationFromStdVector
0031 0016C380 0025C703 ConvertEquationFromStorage
0034 0016C3A0 0025C71E ConvertEquationFromStorageEx
0029 0023B0E0 0025C73B CreateFormattedTextRichEdit
001A 00211170 0025C757 CreateMathXmlHandler
0017 000A1450 0025C76C CreateTextBoxLayout
0004 0000A2C0 0025C780 CreateTextServices
0014 00072E70 0025C793 DisableOleinitCheck
0022 0022D4D0 0025C7A7 DllCanUnloadNow
000C 000B3540 0025C7B7 DllGetVersion
0027 001808D0 0025C7C5 GetLanguageTag
0028 001808F0 0025C7D4 GetLcidFromLang
0016 001F87B0 0025C7E4 GetMathAlphanumeric
0015 001F8B70 0025C7F8 GetMathAlphanumericCode
0035 00207E50 0025C810 GetMathAutoComplete
001B 00208C80 0025C824 GetMathContextMenu
001D 002094E0 0025C837 GetMathContextMenuItems
002F 0020DDD0 0025C84F GetMathSpeechText
0038 000BE460 0025C861 GetOleMathSpeechText
0002 0025CB10 0025C876 IID_IRichEditOle
0003 0025C370 0025C887 IID_IRichEditOleCallback
0025 0025C380 0025C8A0 IID_IRicheditUiaNotificationOverrides
0021 0025C3A0 0025C8C6 IID_IRicheditUiaOverrides
0020 0025C390 0025C8E0 IID_IRicheditWindowlessAccessibility
0018 0025C360 0025C905 IID_ITextDocument2
0006 0025C320 0025C918 IID_ITextHost
0007 0025C310 0025C926 IID_ITextHost2
0010 0025C350 0025C935 IID_ITextHostEx
0005 0025C330 0025C945 IID_ITextServices
0019 0025C340 0025C957 IID_ITextServices2
0030 00171A50 0025C96A IsFontTemporary
0012 002026B0 0025C97A MathBuildDown
0011 00202740 0025C988 MathBuildUp
0013 00202A30 0025C994 MathTranslate
001C 00209AE0 0025C9A2 ProcessMathMenuID
0008 0007A8D0 0025C9B4 REExtendedRegisterClass
001F 0007A8C0 0025C9CC REMSOHInst
0026 00180940 0025C9D7 RegisterLanguageTag
002C 00171B20 0025C9EB RemoveFontFromCache
000F 0006E780 0025C9FF RichComboBoxWndProc
000A 00227830 0025CA13 RichEdit10ANSIWndProc
0009 002278D0 0025CA29 RichEditANSIWndProc
000D 00078620 0025CA3D RichEditWndProc
000E 0006F4F0 0025CA4D RichListBoxWndProc
000B 001E5F60 0025CA60 SetCustomTextOutHandlerEx
002D 001E5570 0025CA7A SetEdpPermissionMode
0024 000BAA40 0025CA8F SetTextServicesDpiCalculationOverride
0023 00071D00 0025CAB5 ShutdownTextServices
0037 00036C00 0025CACA TurnOffMathAutoCompleteList
0036 002082B0 0025CAE6 TurnOnMathAutoCompleteList
001E 0017A900 0025CB01 WriteMathPrSax
Quote from: AW on May 30, 2019, 09:58:23 PM
The full list of rich edit controls is here:
http://masm32.com/board/index.php?topic=7780.msg85317#msg85317
I have done a considerable investigation work on these creepy and cumbersome RichEdit controls and can only congratulate Mr. Murray Sargent and his team for making a living of more than 20 years through obscurity around the RichEdit.
Just for comparison purposes, TRichView is developed by a single person, is 10 times more advanced and is distributed with full source code when purchased, which is not a real fortune.
Quote from: AW on May 31, 2019, 01:09:00 AMA complete Nigerian scam.
Quote from: AW on May 31, 2019, 01:09:00 AMTables are a mess to work with.
QuoteMath symbols don't work, despite claims.
Quote
There are certainly some big problems with math symbols, see the red text.
Quote from: AW on June 01, 2019, 02:26:00 AMCan anyone do the same with the RichEdit control in less than one week? Just a challenge...
.model flat,stdcall
includelib "ole32.lib"
CoMethod1Proto typedef proto :DWORD
CoMethod2Proto typedef proto :DWORD, :DWORD
CoMethod3Proto typedef proto :DWORD, :DWORD, :DWORD
CoMethod4Proto typedef proto :DWORD, :DWORD, :DWORD, :DWORD
CoMethod5Proto typedef proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
CoMethod6Proto typedef proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
CoMethod1 typedef ptr CoMethod1Proto
CoMethod2 typedef ptr CoMethod2Proto
CoMethod3 typedef ptr CoMethod3Proto
CoMethod4 typedef ptr CoMethod4Proto
CoMethod5 typedef ptr CoMethod5Proto
CoMethod6 typedef ptr CoMethod6Proto
IRichEditOleCallback STRUCT
QueryInterface CoMethod3 ?
AddRef CoMethod1 ?
Release CoMethod1 ?
GetNewStorage CoMethod2 ?
GetInPlaceContext CoMethod4 ?
ShowContainerUI CoMethod2 ?
QueryInsertObject CoMethod4 ?
DeleteObject CoMethod2 ?
QueryAcceptData CoMethod6 ?
ContextSensitiveHelp CoMethod3 ?
GetClipboardData CoMethod4 ?
GetDragDropEffect CoMethod4 ?
GetContextMenu CoMethod5 ?
IRichEditOleCallback ENDS
SendMessageA PROTO :DWORD,:DWORD,:DWORD,:DWORD
SendMessage EQU SendMessageA
CreateILockBytesOnHGlobal PROTO :DWORD,:DWORD,:PTR
StgCreateDocfileOnILockBytes PROTO :PTR,:DWORD,:DWORD,:PTR PTR
OutputDebugStringW PROTO :DWORD
OutputDebugString EQU OutputDebugStringW
public STDCALL REOCB_SetComInterface
.code
REOCB_QueryInterface PROC _This:PTR,riid:PTR,ppvObj:PTR
mov eax, 80004002h ; E_NOINTERFACE
ret
REOCB_QueryInterface ENDP
REOCB_AddRef PROC _This:PTR
mov eax, 1h
ret
REOCB_AddRef ENDP
REOCB_Release PROC _This:PTR
mov eax, 1h
ret
REOCB_Release ENDP
REOCB_GetNewStorage PROC _This:PTR,lplpstg:PTR PTR
LOCAL lpLockBytes:PTR
invoke CreateILockBytesOnHGlobal,0,1,ADDR lpLockBytes
.if eax
xor eax, eax
jmp @F
.endif
invoke StgCreateDocfileOnILockBytes,lpLockBytes,1012h,0,lplpstg
@@:
ret
REOCB_GetNewStorage ENDP
REOCB_GetInPlaceContext PROC _This:PTR,lplpFrame:PTR,lplpDoc:PTR,lpFrameInfo:PTR
mov eax, 80004002h
ret
REOCB_GetInPlaceContext ENDP
REOCB_ShowContainerUI PROC _This:PTR,fShow:DWORD
mov eax, 80004002h
ret
REOCB_ShowContainerUI ENDP
REOCB_QueryInsertObject PROC _This:PTR,lpclsid:PTR,lpstg:PTR,cp:DWORD
xor eax, eax ; S_OK
ret
REOCB_QueryInsertObject ENDP
REOCB_DeleteObject PROC _This:PTR,lpoleobj:PTR
mov eax, 80004002h
ret
REOCB_DeleteObject ENDP
REOCB_QueryAcceptData PROC _This:PTR,lpdataobj:PTR,lpcfFormat:PTR,reco:DWORD,fReally:DWORD,hMetaPict:PTR
mov eax, 80004002h
ret
REOCB_QueryAcceptData ENDP
REOCB_ContextSensitiveHelp PROC _This:PTR,fEnterMode:DWORD
mov eax, 80004002h
ret
REOCB_ContextSensitiveHelp ENDP
REOCB_GetClipboardData PROC _This:PTR,lpchrg:PTR,reco:DWORD,lplpdataobj:PTR
mov eax, 80004002h
ret
REOCB_GetClipboardData ENDP
REOCB_GetDragDropEffect PROC _This:PTR,fDrag:DWORD,frfKeyState:DWORD,pwEffect:DWORD PTR
mov eax, 80004002h
ret
REOCB_GetDragDropEffect ENDP
REOCB_GetContextMenu PROC _This:PTR,seltype:WORD,lpoleobj:PTR,lpchrg:PTR,lphmenu:PTR
mov eax, 80004002h
ret
REOCB_GetContextMenu ENDP
.data
IRichEditOleCallbackVtbl IRichEditOleCallback {REOCB_QueryInterface,REOCB_AddRef,REOCB_Release,
REOCB_GetNewStorage,REOCB_GetInPlaceContext,REOCB_ShowContainerUI,
REOCB_QueryInsertObject,REOCB_DeleteObject,REOCB_QueryAcceptData,REOCB_ContextSensitiveHelp,
REOCB_GetClipboardData,REOCB_GetDragDropEffect,REOCB_GetContextMenu}
ReOleCb DWORD OFFSET IRichEditOleCallbackVtbl
.code
REOCB_SetComInterface PROC hWnd:PTR,hEdit:PTR,pReOleCb:PTR
invoke SendMessage,hEdit,446h,0,ADDR ReOleCb
ret
REOCB_SetComInterface ENDP
END
// ReOleCb.c for PellesC
#define WIN32_LEAN_AND_MEAN
#define WIN32_DEFAULT_LIBS
#include <windows.h>
#include <oleidl.h>
#include <richedit.h>
#include <richole.h>
#pragma intrinsic(memcpy)
//const CLSID IID_IUnknown = {0x00000000,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46};
//const CLSID IID_IRichEditOleCallback = {0x00020D03,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46};
int REFIID2String(REFIID riid, TCHAR *szREFIID)
{
return wsprintf(szREFIID,
TEXT("riid = {0x%08X,0x%04X,0x%04X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X};"),
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]);
}
STDMETHODIMP ReOleCb_QueryInterface(IRichEditOleCallback *this, REFIID riid, LPVOID *ppvObj)
{
TCHAR szTmp[100];
REFIID2String(riid, szTmp);
OutputDebugString(szTmp);
*ppvObj = NULL;
OutputDebugString(TEXT("QueryInterface"));
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) ReOleCb_AddRef(IRichEditOleCallback *this)
{
OutputDebugString(TEXT("AddRef"));
return 1;
}
STDMETHODIMP_(ULONG) ReOleCb_Release(IRichEditOleCallback *this)
{
OutputDebugString(TEXT("Release"));
return 1;
}
STDMETHODIMP ReOleCb_GetNewStorage(IRichEditOleCallback *this, LPSTORAGE* lplpstg)
{
OutputDebugString(TEXT("GetNewStorage"));
SCODE sc;
LPLOCKBYTES lpLockBytes = NULL;
sc = CreateILockBytesOnHGlobal(NULL, TRUE, &lpLockBytes);
if (sc != S_OK)
return 0;
sc = StgCreateDocfileOnILockBytes(lpLockBytes,
STGM_SHARE_EXCLUSIVE|STGM_CREATE|STGM_READWRITE, 0, lplpstg);
if (sc != S_OK) lpLockBytes->lpVtbl->Release(lpLockBytes);
return sc;
}
STDMETHODIMP ReOleCb_GetInPlaceContext(IRichEditOleCallback *this, LPOLEINPLACEFRAME *lplpFrame,
LPOLEINPLACEUIWINDOW *lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo)
{
OutputDebugString(TEXT("GetInPlaceContext"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_ShowContainerUI(IRichEditOleCallback *this, BOOL fShow)
{
OutputDebugString(TEXT("ShowContainerUI"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_QueryInsertObject(IRichEditOleCallback *this, LPCLSID lpclsid,
LPSTORAGE lpstg, LONG cp)
{
OutputDebugString(TEXT("QueryInsertObject"));
return S_OK;
}
STDMETHODIMP ReOleCb_DeleteObject(IRichEditOleCallback *this, LPOLEOBJECT lpoöeobj)
{
OutputDebugString(TEXT("DeleteObject"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_QueryAcceptData(IRichEditOleCallback *this, LPDATAOBJECT lpdataobj,
CLIPFORMAT *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
{
OutputDebugString(TEXT("QueryAcceptData"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_ContextSensitiveHelp(IRichEditOleCallback *this, BOOL fEnterMode)
{
OutputDebugString(TEXT("ContextSensitiveHelp"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_GetClipboardData(IRichEditOleCallback *this,
CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj)
{
OutputDebugString(TEXT("GetClipboardData"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_GetDragDropEffect(IRichEditOleCallback *this,
BOOL fDrag, DWORD frfKeyState, PDWORD pwEffect)
{
OutputDebugString(TEXT("GetDragDropEffect"));
return E_NOTIMPL;
}
STDMETHODIMP ReOleCb_GetContextMenu(IRichEditOleCallback *this,
WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE *lpchrg , HMENU *lphmenu)
{
OutputDebugString(TEXT("GetContextMenu"));
return E_NOTIMPL;
}
IRichEditOleCallbackVtbl ReOleVtbl = {
ReOleCb_QueryInterface,
ReOleCb_AddRef,
ReOleCb_Release,
ReOleCb_GetNewStorage,
ReOleCb_GetInPlaceContext,
ReOleCb_ShowContainerUI,
ReOleCb_QueryInsertObject,
ReOleCb_DeleteObject,
ReOleCb_QueryAcceptData,
ReOleCb_ContextSensitiveHelp,
ReOleCb_GetClipboardData,
ReOleCb_GetDragDropEffect,
ReOleCb_GetContextMenu,
};
IRichEditOleCallback ReOle = {&ReOleVtbl};
DWORD RichEditOleCallback_SetComInterface(HWND hWnd, HWND hEdit, IRichEditOleCallback** pReOleCb)
{
return SendMessage(hEdit, EM_SETOLECALLBACK, 0, (LPARAM)&ReOle);
}
Quote from: AW on June 04, 2019, 07:49:03 PMDon't use the MS Office riched20.dll until Mr. Murray starts documenting things properly instead of producing useless marketing blogs.
Quote from: jj2007 on June 04, 2019, 08:41:42 PMQuote from: AW on June 04, 2019, 07:49:03 PMDon't use the MS Office riched20.dll until Mr. Murray starts documenting things properly instead of producing useless marketing blogs.
For many years I used the Office11 version, stable and so far the fastest one. About two years ago I switched to Office12, marginally slower but has a few features more. So far it's pretty stable (I use it several hours every day). It comes with the free Excel viewer - officially retired by M$ but available on several dedicated sites.
Later versions may offer more bells and whistles, but prepare for crashes.
Quote from: AW on June 04, 2019, 09:43:35 PMOffice 11 is Office 2003 and Office 12 is Office 2007. I am talking about more recent stuff.
Quote from: AW on June 04, 2019, 07:49:03 PMchange \wmetafile1 to \wmetafile8 and try again.
The solution from the link above works, except for icons (I can't figure out what is missing).
Quote from: jj2007 on June 04, 2019, 10:28:40 PMQuote from: AW on June 04, 2019, 09:43:35 PMOffice 11 is Office 2003 and Office 12 is Office 2007. I am talking about more recent stuff.
I know. The point is that the Office11+12 RichEd20.dll are freeware.
Quote from: AW on June 05, 2019, 01:28:02 AMI did not know any version of Office was free