Parameter for RTF version to be used

Stimulsoft Reports.NET discussion
Post Reply
rksaskia
Posts: 58
Joined: Fri Apr 27, 2012 9:16 am

Parameter for RTF version to be used

Post by rksaskia »

Hello,

i have seen that in class StiRichTextBox possibly the Control with version RICHEDIT50W is generated.

Code: Select all

namespace Stimulsoft.Report.Controls
{
    /// <summary>
    /// Represents a Windows rich text box control, with some impovements.
    /// </summary>
    [SuppressUnmanagedCodeSecurity]
    [ToolboxItem(false)]
    public class StiRichTextBox : RichTextBox
    {
....
        protected override CreateParams CreateParams
        {
            get
            {
                if (!this.DrawTransparent)
                {
                    return base.CreateParams;
                }
                CreateParams prams = base.CreateParams;
                if (StiRichTextBox.LoadLibrary("msftedit.dll") != IntPtr.Zero)
                {
                    CreateParams exStyle = prams;
                    exStyle.ExStyle = exStyle.ExStyle | 32;
                   prams.ClassName = "RICHEDIT50W";
                }
                return prams;
            }
        }

Please, can you make this setting available as an option? So all RTF work is created with the set version?!
We need this to be able to use all the abilities of the current RTF Control of Windows 10!


Greetings

Here is an overview of the RTF version:

Code: Select all

RICHED32.DLL: v1.0
C:\Windows\System32\RICHED32.DLL
Wrapper Dll for Richedit 1.0
In XP:    File version: 5.1.2600.0
In W7:   File version: 6.1.7601.17514
In W10: File version: 10.0.10586.0
ClassName: 'RICHEDIT'

RICHED20.DLL:  v2.0
C:\Windows\System32\RICHED20.DLL
Rich Text Edit Control, v2.0
5.0.150.0
Microsoft RichEdit Control, version 2.0
ClassName: 'RichEdit20A'

RICHED20.DLL:  v3.0, in XP:
C:\Windows\System32\RICHED20.DLL
Rich Text Edit Control, v3.0
Product version: 3.0
File version:  5.30.23.1230
ClassName: 'RichEdit20A'

RICHED20.DLL:  v3.1, in W7, W10:
C:\Windows\System32\RICHED20.DLL
Rich Text Edit Control, v3.1
Product version: 3.1
File version:  5.31.23.1230
File version:  5.31.23.1231
ClassName: 'RichEdit20A'

Windows XP, Windows 7   :  v4.1
C:\Windows\System32\MSFTEDIT.DLL
Rich Text Edit Control, v4.1
Product version: 4.1
XP SP3:  File version:  5.41.15.1515
W7:       File version:  5.41.21.2510
ClassName: 'RichEdit50W'

Windows 8:   v7.5
C:\Windows\System32\MSFTEDIT.DLL
Control de edición de texto enriquecido, v7.5
Product/file version: 6.2.9200.16657
Product name: Microsoft Windows Operating System
ClassName: 'RichEdit50W'

Windows 10:   v7.5
C:\Windows\System32\MSFTEDIT.DLL
Control de edición de texto enriquecido, v7.5
Product/file version:    10.0.10586.17
Product name: Sistema operativo Microsoft Windows
ClassName: 'RichEdit50W'
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Parameter for RTF version to be used

Post by Andrew »

Hello,

Please tell us which settings do you want to make available as options?

Waiting for your reply.
Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Parameter for RTF version to be used

Post by HighAley »

Hello.

By default, .NET virtual machine is looking for the riched20.dll in the current application directory, then in the Windows/System directory.
We had made some tests and found out that setting the ClassName="RICHEDIT50W" does not affect which library will be loaded exactly.
We were putting different versions of the riched20.dll library in the application folder and each library was loaded and worked with ClassName="RICHEDIT50W".
But when we set ClassName="RICHEDIT60W", then the library from the Office 2007 and later worked only. Other libraries gave us an error.

Therefore, by default, the latest library from the Windows/System directory is used.
If you need to use a later library from MS Office then simply place necessary files in the main application folder.

Thank you.
rksaskia
Posts: 58
Joined: Fri Apr 27, 2012 9:16 am

Re: Parameter for RTF version to be used

Post by rksaskia »

Hello,

First, place riched20.dll in the main application folder is not a possibility if you have mixed 32-bit / 64-bit clients. Our application is started by a network share, not a local installation. On the network share, I can only place one version (32-bit / 64-bit) of riched20.dll.
Second, distribution of riched20.dll is not allow from microsoft.
We had made some tests and found out that setting the ClassName="RICHEDIT50W" does not affect which library will be loaded exactly.
What? Not affect?

See sample.
2017-05-15_1326.png
2017-05-15_1326.png (34.75 KiB) Viewed 5099 times
The problem is, .net by default uses RichEdit 2.0, no matter which version is available in the system. And if there was an option in Stimulsoft, you could change this.
I think an enum, what version (classname) is used, would be best option.

Greetings
Attachments
RtfClass.zip
(96.23 KiB) Downloaded 352 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Parameter for RTF version to be used

Post by HighAley »

Hello.

The support of Rich Text was written about ten years ago. Since then there was a lot of changes.
We reworked the method of extended library loading.

But in design mode the old library was used. There was no CreateParams property.
Also the extended library was used when the Rich Text has transparent background.
In both case the extended RichEd20.dll library was used when it were in the application folder.

We have made an improvement and have added two new options:

StiOptions.Engine.ForceLoadExtendedRichTextLibrary = true;
StiOptions.Engine.ExtendedRichTextLibraryClassName = "RichEdit50W";

The first one force loading of the extended library in any case. It is enabled by default.
The second one is for selecting of the library. By default, it is RichEdit50W. It should work on the most current systems.
But sometimes the extended library is not installed on the machines. So we had to add these options.

Thank you.
rksaskia
Posts: 58
Joined: Fri Apr 27, 2012 9:16 am

Re: Parameter for RTF version to be used

Post by rksaskia »

Thank you first, I will test it!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Parameter for RTF version to be used

Post by Alex K. »

Hello

Ok.
Please let us know if you need any additional help.

Thank you.
Post Reply