Retrieve RTF text

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #66589
    Jerrri2012
    Member

    Hi,

    I tried all tips to retrieve RTF text as it is from a RTF field from pal

    No success 🙁

    Anybody have an idea about how to use em_streamout constant ?

    #66592
    Chike
    Administrator

    Yeah, https://www.imfiles.com/topic/another-way-to-save-paltalk-text/
    And ask Loco to fix his @#$% and permit the source file.

    #66594
    Chike
    Administrator

    OK never mind Loco, he’s too busy at the beach, I’ve uploaded a zip archive instead the source/header files.
    I can change GetRichText to get the buffer and max size as parameters and return integer or bool so it would be easier to use in VB and make a DLL

    bool __stdcall GetRichText(HWND hwndRichEdit, char *sRtf, int iRtfMax);

    and in VB

    Declare Ansi Function GetRichText Lib "EditStream.DLL" _
        (ByVal hwndRichEdit As Long, ByVal sRtf As StringBuffer, ByVal iRtfMax As Integer) As Boolean

     

    #66595
    Chike
    Administrator

    Attached is DLL you may try to use.
    Code is basically the, just fixed a big and removed some flags
    Declare

    Declare Ansi Function GetRichText Lib "ExStreamOut.dll" _
            (ByVal hwndRichEdit As Integer, ByVal sRtf As StringBuilder, ByVal iRtfMax As Integer) As Integer

    If there is insufficient space the function return the number of bytes needed (negative number)
    If the function fails for some other reason it return -Int32.MaxValue.
    example call to the function

    Dim Rtf As New StringBuilder ' (1)
    Dim res As Integer
    While True
    res = GetRichText(richHandle, Rtf, Rtf.Capacity)
    If res > 0 Or res = -Int32.MaxValue Then
    Exit While
    End If
    Rtf.Capacity += -res
    End While
    Attachments:
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.