Opened 16 years ago
Closed 14 years ago
#1319 closed Bug (Fixed)
AutoIt3.exe always exists after closing script with RichEdit
| Reported by: | BugFix | Owned by: | trancexx |
|---|---|---|---|
| Milestone: | 3.3.9.1 | Component: | AutoIt |
| Version: | 3.3.1.6 | Severity: | None |
| Keywords: | Cc: |
Description
Hi,
i've used in SciTE the following script with Windows XP Home SP2. At first with Beta 3.1.1.5 .
After ending exists furthermore process AutoIt3.exe with an CPU load of 98 %.
Then i've updated to Beta 3.3.1.6 with same effect.
#include <EditConstants.au3>
#include <GuiRichEdit.au3>
$Form1 = GUICreate("Form1", 400, 500, 300, 220)
$Edit = _GUICtrlRichEdit_Create($Form1, "", 10, 10, 380, 360, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL))
GUISetState(@SW_SHOW)
Do
Until GUIGetMsg() = -3
Attachments (0)
Change History (11)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
this is a workaround working on xp:
;#BETA
#include <EditConstants.au3>
#include <GuiRichEdit.au3>
OnAutoItExitRegister("KillRichEdit")
$Form1 = GUICreate("Form1", 400, 500, 300, 220)
$Edit = _GUICtrlRichEdit_Create($Form1, "", 10, 10, 380, 360, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL))
GUISetState(@SW_SHOW)
Do
Until GUIGetMsg() = -3
Func KillRichEdit()
_GUICtrlRichEdit_Destroy($Edit)
EndFunc
comment:3 by , 16 years ago
Found the error:
I think it is __GCR_SetOLECallback($hRichEdit) wich is called in _GUICtrlRichEdit_Create.
When AutoIt is being closed, the callbacks or the dllstructs are freed before the RichEdit was destroyed. The Richedit tries to call the release function of the "object", but since it does not exist anymore, this leads to unexpected behaviour.
It should be documented that you have to use _GUICtrlRichEdit_Destroy on exit. Also, the COM-Object should not be initialised for each richedit. Sometimes a RichEdit without image-support is needed. I propose to remove __GCR_SetOLECallback from the create function and document instead that you have to call an other function for image support.
comment:5 by , 16 years ago
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
| Version: | 3.3.1.6 → 3.3.2.0 |
comment:7 by , 16 years ago
| Milestone: | Future Release |
|---|---|
| Resolution: | Fixed |
| Status: | closed → reopened |
| Version: | 3.3.2.0 → 3.3.1.6 |
If I wanted this ticket closed I would have closed this ticket.
comment:8 by , 16 years ago
I propose to remove GCR_SetOLECallback from the create function and document instead that you have to call an other function for image support.
I agree, I haven't done thorough testing, but calling GCR_SetOLECallback() after the control is created works just as well. And it runs just as good without it.
_GUICtrlRichEdit_EnableOLE($fEnabled = True)
Could be used to enable the ole (image etc support)
comment:9 by , 16 years ago
| Owner: | set to |
|---|---|
| Status: | reopened → assigned |
comment:10 by , 16 years ago
Not sure to understand what must be done in _GUICtrlRichEdit_EnableOLE( False) after usage of a successful _GUICtrlRichEdit_EnableOLE( True)
comment:11 by , 14 years ago
| Milestone: | → 3.3.9.1 |
|---|---|
| Owner: | changed from to |
| Resolution: | → Fixed |
| Status: | assigned → closed |
Fixed by revision [6805] in version: 3.3.9.1

Nearly the same on Windows 7. But on seven the Script just fatal exit:
!>17:57:55 AutoIT3.exe ended.rc:-1073741819
No CPU load.