Here is a list of features new to or extended in Rich Edit 3.0. This information is taken largely from Microsoft's developer site as of December 13, 1998, and I consider it to be very preliminary. I have only begun testing of these features and, therefore, cannot attest to the accuracy of the information. To get the most up-to-date information, see the Microsoft developer site link on the main page and keep checking back with this site.
I have organized the information into the following rather arbitrary categories (see the last category for new information):
Ok, some of this page is old news. This Rich Edit 3.0 thing is evolving each day so check the last category ("Latest Information") for the newest information.
The Rich Edit 3.0 control adds or improves support in a number of areas. Most notable to me are:
Improved character and paragraph formatting including built-in normal and heading styles, paragraph numbering, basic table support, and more underline types and colors.
Better program control such as the ability to defer screen updates across multiple content changes (you should be able to reduce screen flicker when inserting and modifying multiple lines of text), fetching and restoring the current scroll position precisely, suspending and resuming undo recording, and the ability to (as I read it) increase or decrease the size of fonts in text containing mixed text sizes while retaining relative font sizes. Also, there is improved support, or at least better documentation, for the Text Object Model (TOM).
Other nice finishing touches such as support for smart quotes, soft hyphenation, and an italics cursor.
Finally, there is better support for internationalization and "RTF roundtripping." (For more information on international character support, see the Microsoft Developer Network link on the main page.) RTF roundtripping, as I understand it, is the ability to retain RTF formatting that the Rich Edit control cannot actually display. For example, Rich Edit 2.0 had a number of character and paragraph formatting codes that the control could recognize but not display. You could recognize, and even set, formats such as paragraph borders programmatically even though the control would not actually display them. This is presumably useful only if you would be viewing the RTF text later in a more sophisticated word processor such as Microsoft Word. I assume that "improved RTF roundtripping" means that RTF formatting not supported directly by Rich Edit 3.0 will not be lost when editing the text.
Anyway, here are some of the details:
Rich Edit 2.0 supported setting paragraph numbering styles for RTF roundtripping. The control now supports displaying numeric, upper/lower alphabetic, or Roman numeral paragraph numbering. The depth of paragraph numbering is apparently limited to one (per the online documentation). These features are implemented in the existing CHARFORMAT2 and PARAFORMAT2 structures.
Support for simple tables (no wrapping inside cells) is now included. The user interface is limited -- there is no support for resizing -- but you can delete and insert rows. By enabling "advanced typography," you can set column alignments within cells. See the EM_GETTYPOGRAPHYOPTIONS and EM_SETTYPOGRAPHYOPTIONS messages for enabling the column alignment within table cells. (I am unsure how to put text into tables, but check back here occasionally for more information as I get it.)
Normal and heading styles
Normal style and heading styles 1 through 9 are supported. See the EM_SETPARAFORMAT and EM_GETPARAFORMAT messages and the TOM interfaces.
More underline types
Rich Edit 2.0 implemented more underline types than were actually documented. Now we get documented support for dashed, dash-dot, dash-dot-dot, and dot underlines. See the CHARFORMAT2 structure for more information.
15 colors of underlines are now documented as supported. See the CHARFORMAT2 structure for more information.
RTF roundtripping support is now provided for hidden text.
In older versions of the Rich Edit control, the size of the text within the Rich Edit control on the screen was a direct function of the formatted size of the text in the control. Now, you can increase or decrease the size of the text within the control from 1/64th to 64 times the underlying font size. (Tests indicate a downward limit of 100%, significant visual evidence of upward scaling beyond 200%, and bugs in reporting the true zoom factor when less than 100% (i.e., <64/64) -- but this should be considered *very* preliminary.) This functionality is implemented in the new EM_GETZOOM and EM_SETZOOM messages.
Increased Freeze Control
The display can be frozen over multiple API calls and then unfrozen to display the updates. This should allow you to, for example, insert multiple lines of text without visibly changing the control's contents until all changes are complete. (This is in the online documentation, but I have not found specifics on how to do this.)
Better Control Over Scrolling
One of the most frequently asked Rich Edit questions on newsgroups is "How do I position the Rich Edit control back to the position prior to appending text?" This is at least partially solved with Rich Edit 3.0; the control supports messages to retrieve and restore the *pixel* position within the control's "virtual text space." (The only complication that I foresee is if the text prior to the current control scroll position is modified....) The EM_GETSCROLLPOS and EM_SETSCROLLPOS messages are provided to support this clearly needed functionality.
Increased Undo Control
You can now suspend and resume undo tracking. (Yes, again, I do not yet know how to do this.)
Increase/Decrease Font Size
Rich Edit 3.0 allows you to increase or decrease font sizes to one of six standard values (12, 28, 36, 48, 72, 80 points). Although I have not yet tried it, I take this to mean that you can select a range of text and instruct the control to increase or decrease the (potentially multiple) font size(s) all at once. Again assuming that I understand the online documentation, this should be different than changing the zoom factor as described above; changing the zoom factor should change what is displayed but not what is printed or stored in files -- changing the font size should affect what is printed and stored and displayed in other RTF-enabled word processing applications. See the new EM_SETFONTSIZE message for more information.
Text Object Model (TOM)
Microsoft has finally documented the TOM interfaces. With TOM, programs can manage the Rich Edit 2.0 and 3.0 (and possibly Microsoft Word and other TOM-compliant word processor) document contents using OLE interfaces. Significantly more information about these interfaces is now available on the Microsoft developer's site. See the Microsoft developer link on the main page.
More default hot keys
Hot keys now operate similarly to Microsoft Word default hot keys. For example, the number hot key (CTRL+L) now cycles through numbering options available, starting with the bullet style.
Smart-quotes can now be toggled on and off using CTRL+ALT+' on US keyboards.
Soft hyphens (presumably providing more advanced word and line breaks) are supported. (Use 0xAD in plain text; \- in RTF.)
With Rich Edit 2.0 and before, the cursor remained strictly vertical when editing italics text. Rich Edit 3.0 slants the cursor when inside italics text. Also the mouse pointer changes to a hand when moved over URLs. This was, I believe, supported under Rich Edit 2.0 -- now it is documented.
To use the Rich Edit 3.0 control, you will need two things: The Rich Edit 3.0 DLL and updated header files with additional version 3.0 declarations.
A kind visitor, Michael Tan, offered the following news, solving the first problem:
In the newly released Office 2000 Resource Kit (free), you can find riched20.dll, the Rich Edit 3.0 DLL!!
Here's the link: http://www.microsoft.com/office/ork/2000/appndx/toolbox.htm
(Michael gets special credit because he is not a Borland product user and, presumably, not a regular site visitor. In spite of that, he was the first to pass on this information. Thanks for taking the time, Michael!)
The easiest way to get the Rich Edit 3.0 DLL is to install the Office 2000 Resource Kit (ORK). However, if you do not want to install the ORK, here are the detailed steps to download and extract only the Rich Edit DLL:
Find the riched20.dll file on your machine (if you previously had it) and make a note about where you found it. For Windows98, the file is in the \Windows\System folder by default. Make a copy of this file as a backup.
Go to the page linked above. Download ORKTools.exe (approximately 9MB).
Run the executable or extract the files from ORKTools.exe using PKZIP, WinZip, or a similar tool, to an empty folder.
In that folder, find the MSI subfolder. Locate instmsi.exe in that subfolder.
Extract the riched20.dll (you may also need usp10.dll) from instmsi.exe, either by running it or using PKZIP, WinZip, or a similar tool.
Copy the new riched20.dll to the folder where the original version was located in the first step above.
Restart your machine (probably not necessary, but a good precautionary measure).
At this point, any program that previously used Rich Edit 2.0 will now actually execute Rich Edit 3.0. Of course, these programs will not automatically provide any additional functionality (unless, of course, they were written to recognize which Rich Edit version they were using possible, but unlikely today). The good news is that you now have the benefit of any bug-fixes that Rich Edit 3.0 provides.
I suspect that Rich Edit 3.0 is still evolving if you find a newer version than the following, please let me know.
Created: 02-05-99 2:57:32 pm
File version: 184.108.40.2060
Now for the second part of the problem where to get the necessary header files.
There are several header files that you will or may need. Richedit.h contains the basic Rich Edit declarations that you will almost certainly need. RichOle.h contains OLE interface declarations that you probably want. Tom.h contains the Text Object Model (OLE) declarations that you will probably not need today. However, TOM contains some truly slick interfaces which Microsoft hopes that we will all learn to rely upon. My experience to date: The Rich Edit 2.0/3.0 controls do not implement TOM functionality particularly well or completely. For now, you can easily ignore it.
So, where to get updated versions of the header files? Zulkarnain Lah sent the following information:
In my Internet Client SDK headers and samples dir:
\Include\NT5\richedit.h; Size: 35.8K (36,753b); Created: 03-25-1999; Modified: 03-25-1999
\Include\NT50\richole.h; Size: 6.36K (6518b); Created: 03-25-1999; Modified: 03-25-1999
In my Platform SDK:
\include\Richedit.h; Size: 35.5K (36,440b); Created: 05-10-1999; Modified: 06-19-1998
\include\RichOle.h; Size: 6.32K (6473b); Created: 05-10-1999; Modified: 04-02-1998
tom.h only in Platform SDK.
Naturally, I went immediately to MSDN to search for free versions of the Platform SDK and Internet Client SDK. I found the Platform SDK (iBldEnv.exe) and downloaded it. In that file (a ZIP executable), I found Win32-B.cab which contains INCLUDE_Richedit.h (06-18-98), INCLUDE_RichOle.h (04-01-98), and INCLUDE_TOM.h (06-09-98). All of these are older than the Internet Client SDK files that Mr. Zulkarnain mentions. However, when I found the Internet Client SDK pages, they led me back to the Platform SDK for these files. Oh, well....
Every time I turn around, Microsoft changes the MSDN site and I find that I can no longer locate the SDK download. Thanks to Shawn Bullock for passing on the following links and information which works as of 07-24-99:
Platform SDK Page: http://msdn.microsoft.com/developer/sdk/platform.asp
Platform SDK Download Page: http://www.microsoft.com/msdownload/platformsdk/setuplauncher.htm
From the Platform SDK page, there is a link to the Platform SDK Download page labeled as something like "Platform SDK setup." Currently, it takes you to the second link above which allows you to run the first stage setup program. This setup program lets you select which Platform SDK components to download. Once you have selected the items to download, it runs a second setup program that actually downloads and installs the selected items. Warning: I was worried that Microsoft would again change the links so I grabbed all of the components at once. This download took several days at 56 kbps to complete and, I think, more than a gigabyte of disk space. You probably will want to be somewhat more selective although I cannot tell you what, exactly, you will need for Rich Edit 3.0.
Note: The Platform SDK help files contain the Rich Edit documentation. This is great -- no more going online to get the basic information!
Many thanks to Mr. Zulkarnain and Mr. Bullock for giving us something to work with. If you know where to find more recent versions of these files, please share.
Rich Edit 3.0 is no more complex than Rich Edit 2.0. Microsoft recently revamped the MSDN site (see the Links page) and it now includes substantially more information about both versions. Unfortunately, some of the information is inaccurate or easily misunderstood, so I will be working through it for a while. Let me know what you learn.
Once you have Rich Edit 3.0 installed, see the Rich Edit 3.0 Code Samples page for what I have learned about the Rich Edit 3.0 so far and code to get you started using it with the Borland VCL.
Joel Harrison informed me that the "\page" RTF code does actually work in Rich Edit 3.0. I have tested and confirmed this with Rich Edit 3.0 version 5.30.18.0300 on Windows 98. This is great news -- thanks, Joel! Now the bad news: The obvious way to insert a page break in Rich Edit 3.0 is to use the PFE_PAGEBREAKBEFORE and PFM_PAGEBREAKBEFORE flags in the PARAFORMAT2 structure. This inserts a "\pagebb" RTF code which does nothing when rendering. So how do we insert the "\page" code and, once inserted, how do we find and remove it?
Shawn Bullock offers the following: "Just as an update, there is now another source where one might find the necessary header files and (dlls?)... the September Edition of Platform SDK. My CD came with the October shipment of MSDN Universal (likely professional also) and can still be downloaded in the usual spot, and is also available as part of the Windows2000 SDK, too..."
New information as of January 13, 2000
Would you believe that Microsoft has a page that looks up DLLs and tells you where they came from? Thanks to a frequent but anonymous (by his request) visitor for the following links:
To search Microsoft's site for the distribution code/product that contains a specific DLL. See The Microsoft DLL Help Database.
He added the following:
For NT -- So you don't have to redownload the whole platform sdk, I should also say that the msi package is available at:
or For Windows 9x --
Eric DuPont provided the following source for Rich Edit 3.0 (riched20.dll; version 5.30.13.0906): http://www.smartftp.com/smartftp/Riched30.exe. The home page is http://www.smartftp.com/download.html.
Please send me additional information as you get it or figure it out so that we can help those that follow -- rest assured that you will get full credit for your contributions to the site.
In particular, if you learn how to use new functionality or identify other products with which Rich Edit 3.0 is distributed, please let me know.
Copyright © 1998, 1999, 2000 Thin Air Enterprises and Robert Dunn. All rights reserved.