Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Implementing Rich Text Edit Functionality

I attempted to recreate the form and commuter module in the RTI help of the same title, but noticed that it might be somewhat dated since it didn't work.
Reading up about RTF in the MS documentation I found that the latest DLL is MSFTEdit.DLL of which I was able to extract the commands using DLL Export Viewer
For me to continue my research if this is a viable solution for the project I am working on I need a starting point, namely how to connect the DLL mentioned with the form. what is the name in that need to be written in the TEXT field.
Secondly (since I don't see the commands that were used in the programming in the Help text) If I can be pointed to some documentation regarding the commands I found in the MSFTEdit.DLL shown below
Any help appreciated

I have a spreadsheet with all the commands that are inside this DLL.
«1

Comments

  • I am not sure MSFTEdit.dll can be loaded into an OLE control this way. You mentioned "MS documentation". Can you share the link for this?
  • Good morning Don,
    The documentation that I was reading is https://docs.microsoft.com/en-us/windows/win32/controls/using-rich-edit-controls
    In reality I just wanted the program in the RTI 9.4 help to be working as is, but it didn't
  • I can't find anything in the RTI 9.4 help that references "Implementing Rich Text Edit Functionality". Is this in the Programmer's Reference Guide or another help file? Perhaps if you copied it entirely here it would help.
  • Attached is the documentation of the commands
  • Here is the screen print as to how I found the help
  • Thank you. I would have expected this in the Programmer's Reference Guide but your screenshot helped me to locate it in the general help section.

    The article certainly suggests you can use RTF as an ActiveX control, but I encountered difficulties getting this to work. Probably the same difficulties you faced.

    Knowing your end goal is to provide WYSIWYG features within OI that can then be implemented in a Word document, perhaps a commercial product like TX Text Control ActiveX would suit you better.

  • Don looking at the documentation for MSFTEdit.dll it looks to me that IRichEditOle commands should be able to executed am I wrong in thinking that?
  • This is beyond my pay grade. I see the references to COM, but I don't see where this is exposed as an ActiveX control that you can easily access via the OI OLE control.
  • What was scary to begin with is that it said that the name that you put in the TEXT field could be different on your computer without the reasoning behind it.
  • The reasoning is most likely related to versioning or the possibility of it being replaced down the line.
  • While continuing working on the implantation of RFT in edit box I have come to a point that need your help again.
    I need to be able to change the font for a selection. For all my other manipulations I was able to use SETCHARFORMAT. for color I used the CHOOSECOLOR utility and was planning to use CHOOSEFONT to manipulate the font and size so the question is how to interpret the font structure and the charformat

  • You can refer to the documentation on FONT and SETCHARFORMAT to map from one to the other.
  • Kevin that is the problem. I need to set the size and font name but I can't see the size in either. Looks like it is a combination of values, so I need to know what the combination is.
  • The CharFormat structure uses twips to define the size of the font. 1 twip ~ .05 pts. Thus, your CharFormat sample has 180 twips as the size which converts to 9 pts.
  • Thanks Don I didn't see the pts in the font structure either
    Is it in twips their too?
  • No, FONT uses the LOGFONT structure. Height is not in pts, but in logical units. This is why the number is often negative.
  • Since I know how to set the size is there a way to retrieve all the installed font on a workstation?
  • Before I answer that, is the purpose to provide the user with a list of fonts to choose from?
  • I have found the list of installed fonts using the following code
    -------------------------------------------------------------------------------------
    directory = "C:\Windows\Fonts"
    filter = "*.ttf"
    Fonts = RTI_OS_Directory( "GETFILES", directory, filter )
    -------------------------------------------------------------------------------------
    Now I am trying to get the long name since this looks like the short name.
  • You didn't answer my question. What do you intend to do with this list?
  • I want to show all the fonts that are available on a workstation so the user can choose from it.(this will be the font button and secondly they will be able to choose the size they want ( I am thinking to give them a choice starting from 8 till 16 )
    I want to show the font names as in the attached file.
  • So would the CHOOSEFONT service do what you want?
  • That is where I started. but as I said before the fontstructure and setcharformat layouts are confusing me so I want to show only the fonts separately from the size
  • I see. Well, if you want to roll out your own then I don't think there is anything out of the box that you can use. You'll probably have to work with the EnumFontFamilies API.
  • I was looking at that. But my API skills have deteriorated some.
  • I have to create a record in OI that points to the API?
  • You would update the DLL_GDI32 record or create a new one to avoid interfering with the default one. However, I'm not sure if you can make this work strictly within OI. Perhaps Kevin will chime in and set us both straight.
  • Love the lighting bolt in the srp editor. Was able to test everything we were talking about fast.
  • EnumFontFamiliesA requires a callback. I've never used those, but I know there is support for them. Perhaps the Revelation boards will have some examples.
  • This thread discusses this very issue and uses EnumWindows as an example. Bob Carten provided a code sample.
Sign In or Register to comment.