Modify ↓
Opened 8 months ago
Closed 8 months 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 8 months ago by Jpm
- Milestone set to 3.3.17.0
- Owner set to Jpm
- Resolution set to Fixed
- Status changed from new to closed
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.
Note: See
TracTickets for help on using
tickets.

Fixed by revision [13094] in version: 3.3.17.0