I wan't to create multiple GUI's with each there own RichEdit control. But only the first richedit is correctly created.
Below you can find demo code to illustrate the problem. Anyone an idea why error 1 is returned and what error 1 means (no such error described in the help files)
Test include 1 GUI and creating 2 richedit controls. The other test will create a second window with a new richedit control. Both are failing.
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Main()
Func Main()
Local $hGui, $hRichEdit, $iMsg
Local $hGui02, $hRichEdit02, $iMsg02
Local $hGui03
$hGui = GUICreate("Example01 (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 100, 100, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
ConsoleWrite(@error&@CRLF) ; =======> return 0
_GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text")
GUISetState()
$hRichEdit03 = _GUICtrlRichEdit_Create($hGui, "This is a test.", 120, 120, 100, 100, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
ConsoleWrite(@error&@CRLF) ; =======> return 1
_GUICtrlRichEdit_AppendText($hRichEdit03, @CR & "This is more text")
GUISetState()
$hGui02 = GUICreate("Example02 (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1)
$hRichEdit02 = _GUICtrlRichEdit_Create($hGui02, "This is a test.", 10, 10, 100, 100, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
ConsoleWrite(@error&@CRLF) ; =======> return 1
_GUICtrlRichEdit_AppendText($hRichEdit02, @CR & "This is more text")
GUISetState()
While True
$iMsg = GUIGetMsg()
Select
Case $iMsg = $GUI_EVENT_CLOSE
_GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
_GUICtrlRichEdit_Destroy($hRichEdit02) ; needed unless script crashes
;~ GUIDelete() ; is OK too
Exit
EndSelect
WEnd
EndFunc ;==>Main