Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RTF-RichTextBox and Highlighting
Message
De
15/08/2006 20:58:59
 
 
À
15/08/2006 18:32:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01145456
Message ID:
01145849
Vues:
75
>1. I work with both Win2K and WinXP; but this is a developer tool that I am creating so the OS can be varied.
>
>2. Ver 6.0.88.77 (from richtx32.ocx properties) -- in the VFP OCX add only the version is given.
>
>3. The following is the result from GetModuleHandle: 1961033728

Okay. The OS can be varied is the reason of my question. The reason is I have "RTF V6 (SP4)" under ME, and "RTF V6 (SP6)" under XP-SP2. The results of GetModuleHandle for RTF V6 (SP6) under XP is not 0. But for RTF V6 (SP4) under ME is 0.

You have RTF V6 (SP4), but the result of GetModuleHandle is not 0. So, I think it is better if you put the GetModuleHandle in the RTF init event, to make sure that the RTF ActiveX control is using RichEdit version 2.0/3.0 engine. For example:
If (GetModuleHandle( 'RichEd20.dll' ) != 0)
   nRichEditVer = 2  && RichEdit ver 2/3 engine
else
   nRichEditVer = 1  && RichEdit ver 1 engine
endif
The point for that code is, to send EM_GETCHARFORMAT / EM_SETCHARFORMAT message using CHARFORMAT2 structure only available on RichEdit engine ver 2 or higher

>
>Where did you get the structure for the CharFormat2? I have looked on the internet and have MSDN help -- mine was based on the help file. Thanks.

Yes, your structure is correct according to MSDN help. However, I think there is a bit misdocumented. The correct structure for CHARFORMAT2 is actually based on CHARFORMAT structure plus several new fields. The CHARFORMAT is not properly aligned by 4 bytes (for 32 bits processor). So, the compiler will align the structure to make it divisible by 4 bytes in to gain fastest performance. The result is the "wPad" after "szFaceName" field.

For more info, look at "structure alignment in Win32" in MSDN help. You can also try it using VC++ compiler.

Regards
Herman
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform