Modify

#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 anonymous, on Nov 29, 2009 at 5:03:09 PM

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.

comment:2 by ProgAndy, on Nov 29, 2009 at 5:09:11 PM

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 ProgAndy, on Nov 29, 2009 at 5:38:35 PM

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:4 by Valik, on Dec 10, 2009 at 4:20:13 AM

This ticket is referenced in revision: [5442]

comment:5 by Jpm, on Jan 6, 2010 at 5:07:32 PM

Resolution: Fixed
Status: newclosed
Version: 3.3.1.63.3.2.0

comment:6 by TicketCleanup, on Jan 6, 2010 at 6:00:02 PM

Milestone: Future Release

Automatic ticket cleanup.

comment:7 by Valik, on Jan 6, 2010 at 6:07:07 PM

Milestone: Future Release
Resolution: Fixed
Status: closedreopened
Version: 3.3.2.03.3.1.6

If I wanted this ticket closed I would have closed this ticket.

comment:8 by anon, on Apr 16, 2010 at 1:24:39 AM

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 Jpm, on Apr 27, 2010 at 5:35:20 PM

Owner: set to Valik
Status: reopenedassigned

comment:10 by Jpm, on Apr 27, 2010 at 6:14:12 PM

Not sure to understand what must be done in _GUICtrlRichEdit_EnableOLE( False) after usage of a successful _GUICtrlRichEdit_EnableOLE( True)

comment:11 by trancexx, on Feb 21, 2012 at 12:03:38 AM

Milestone: 3.3.9.1
Owner: changed from Valik to trancexx
Resolution: Fixed
Status: assignedclosed

Fixed by revision [6805] in version: 3.3.9.1

Modify Ticket

Action
as closed The owner will remain trancexx.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.