Modify

Opened 5 weeks ago

Closed 2 weeks ago

#4038 closed Bug (Fixed)

_GUICtrlRichEdit_StreamToFile adds new paragraph at the end on every open to save

Reported by: anonymous Owned by: Jpm
Milestone: 3.3.17.0 Component: Standard UDFs
Version: 3.3.14.0 Severity: None
Keywords: _GUICtrlRichEdit_StreamToFile Cc:

Description

see:

https://www.autoitscript.com/forum/topic/212753-richedit-streamtofile-adds-newline-every-time/

example code + temp solution:

#include <GUIConstants.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", True)

;~ $__g_pGRC_StreamToFileCallback = DllCallbackRegister("__GCR_StreamToFileCallbackEx", "dword", "long_ptr;ptr;long;ptr")

Example()

Func Example()
  Local $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 320, 350, -1, -1)
  Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
      BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
  Local $idBtnIn = GUICtrlCreateButton("In", 270, 310, 40, 30)
  Local $idBtnOut = GUICtrlCreateButton("Out", 170, 310, 40, 30)
  GUISetState(@SW_SHOW)

  _GUICtrlRichEdit_SetText($hRichEdit, "First paragraph")
  While True
    Switch GUIGetMsg()
      Case $GUI_EVENT_CLOSE
        ExitLoop
      Case $idBtnOut
        _GUICtrlRichEdit_StreamToFile($hRichEdit, @DesktopDir & "\gcre.rtf")
      Case $idBtnIn
        _GUICtrlRichEdit_StreamFromFile($hRichEdit, @DesktopDir & "\gcre.rtf")
    EndSwitch
  WEnd
  _GUICtrlRichEdit_Destroy($hRichEdit)
EndFunc   ;==>Example

Attachments (0)

Change History (1)

comment:1 Changed 2 weeks ago by Jpm

  • Milestone set to 3.3.17.0
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [13094] in version: 3.3.17.0

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.