AutoIt Forums: GUICtrlCreateObj Crash in 3.1.1.102 - AutoIt Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

GUICtrlCreateObj Crash in 3.1.1.102 FIXED 3.1.1.103 (provisionally)

#1 User is offline   SvenP 

  • AutoIt COMposer
  • Icon
  • Group: Developers(Dev)
  • Posts: 639
  • Joined: 04-January 05
  • Location:The Netherlands

Posted 20 January 2006 - 04:55 PM

Randallc reported me an AutoIt crash on exit, occuring in 3.1.1.102. It is reproducable using the following example:

[ code='text' ]    ( Popup )
$Gui = GUICreate("test ", 1005, 611) ;$ExcelLV = ObjCreate("OWC11.spreadsheet")  ; Use this for Office 2003 $ExcelLV = ObjCreate("OWC.spreadsheet")  ; Use this for Office 2000 $GUI_ActiveX = GUICtrlCreateObj($ExcelLV,110, 60, 827, 488) GUIDelete() $ExcelLV=0  ; <-- causes hard crash. When omitting this line, AutoIt crashes on exit.


The ExcelLV object seems to have itself deleted from memory after the GUIDelete(), then AutoIt crashes when it wants to delete this already deleted object.

This is the result of me, re-fixing a temporary fix of an old bug in v3.1.1.84 (18-nov-2005).

I will try to fix the fix of the temporary fix of this bug...otherwise I'll stick with the temporary fix.


-Sven

EDIT 2005-01-20: Simplified the example code.

This post has been edited by SvenP: 20 January 2006 - 09:41 PM

0

#2 User is offline   SumTingWong 

  • My custom member title
  • PipPipPipPip
  • Group: Full Members
  • Posts: 360
  • Joined: 05-April 04
  • Location:London, UK

Posted 20 January 2006 - 05:22 PM

View PostSvenP, on Jan 20 2006, 03:55 PM, said:

I will try to fix the fix of the temporary fix of this bug...otherwise I'll stick with the temporary fix.
-Sven


Does that mean this fix will now be the fix of the fix of the temporary fix? :lmao:
0

#3 User is offline   eltorro 

  • Trying to be less polite
  • PipPipPipPip
  • Group: Full Members
  • Posts: 579
  • Joined: 23-July 05

Posted 20 January 2006 - 06:29 PM

Fix the fix, the fix to fix. B)
0

#4 User is offline   kjactive 

  • Mass Spammer!
  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 683
  • Joined: 16-February 05
  • Gender:Male
  • Location:Copenhagen, Denmark

Posted 20 January 2006 - 07:01 PM

SvenP - some of the components has internal quit method, I do not have the OWC11. so I can't check and I don't know if this is the reason just wanted to mention...

Keep up your good work on components

kjactive :lmao:
0

#5 User is offline   SvenP 

  • AutoIt COMposer
  • Icon
  • Group: Developers(Dev)
  • Posts: 639
  • Joined: 04-January 05
  • Location:The Netherlands

Posted 20 January 2006 - 09:34 PM

View Postkjactive, on Jan 20 2006, 07:01 PM, said:

SvenP - some of the components has internal quit method, I do not have the OWC11. so I can't check and I don't know if this is the reason just wanted to mention...

Keep up your good work on components

kjactive :lmao:

kjactive,

OWC are the Office Web Components. They come with the Microsoft Office Package. When you have Office 2000, these components are called "OWC.SpreadSheet", "OWC.PivotTable", etc.
All these OWC components seem to have the same problem: when you load them in an ActiveX container and you close the container, the controls seem to be wiped from memory. Bad, bad, because I had still an active IDispatch interface to them (by ObjCreate()).

The problem is, I don't know a way to indentify these type of control from any others. Otherwise I could give them a 'special treatment'.

(No, coding a line "IF OBJNAME STARTS WITH OWC" is not the proper way to fix this problem...)


-Sven
0

#6 User is offline   Valik 

  • Searching for something that doesn't exist.
  • Icon
  • Group: Developers(Dev)
  • Posts: 13,859
  • Joined: 05-December 03
  • Gender:Male
  • Location:Silent Hill

Posted 20 January 2006 - 09:42 PM

Sven, what does AddRef()/Release() return on these interfaces? I have a random hunch that it might return "1" no matter what the current reference count may be. You could perhaps try something like this:
[ code='text' ]    ( Popup )
IDispatch *pDispatch; // Get the object ULONG ref = pDispatch->AddRef(); if (ref < 2) {     // Funny business, we know the reference count is at least 2.     // Our pointer is one reference and we just called AddRef()     // which makes the second reference we control. } pDispatch->Release();

0

#7 User is offline   SvenP 

  • AutoIt COMposer
  • Icon
  • Group: Developers(Dev)
  • Posts: 639
  • Joined: 04-January 05
  • Location:The Netherlands

Posted 20 January 2006 - 10:05 PM

View PostValik, on Jan 20 2006, 09:42 PM, said:

Sven, what does AddRef()/Release() return on these interfaces? I have a random hunch that it might return "1" no matter what the current reference count may be. You could perhaps try something like this:
...


I've continued the technical details in the dev's private forum.

-Sven
0

#8 User is offline   kjactive 

  • Mass Spammer!
  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 683
  • Joined: 16-February 05
  • Gender:Male
  • Location:Copenhagen, Denmark

Posted 21 January 2006 - 11:08 AM

Well I did a test on this problem reported and I could not reproduce the trouble but still I only got the OWC 9 and 10 object serie to do a test on...

[ code='text' ]    ( Popup )
$ExcelLV = ObjCreate("OWC.spreadsheet"); let windows select the objects ( OWC10.preadsheet.10 ) GUICreate("Embedded Web control Test", 640, 580) $GUI_ActiveX = GUICtrlCreateObj($ExcelLV, 0, 0, 640, 580) GUISetState() While 1     $msg = GUIGetMsg()     Select           Case $msg = -3             ExitLoop     EndSelect WEnd GUIDelete() $ExcelLV = 0; <-- causes hard crash. When omitting this line, AutoIt crashes on exit.


This semilare code do not produce any trouble on my WinXP Service Pack 2 updated computer, GuiCreate before or after the 'create object' makes no difference, with or without freeing the component, with or without Guidelete still the same - I could not reproduce this troble in any conditions with the OWC 10 spreadsheet...

Sorry

Quote

The problem is, I don't know a way to indentify these type of control from any others. Otherwise I could give them a 'special treatment'.

I would just love to see that function too - I'm stucked in an almost finished Com object editer appliaction for the same reason - is there any suggestions out there, dam it...

kjactive :nuke:

This post has been edited by kjactive: 21 January 2006 - 11:13 AM

0

#9 User is offline   SvenP 

  • AutoIt COMposer
  • Icon
  • Group: Developers(Dev)
  • Posts: 639
  • Joined: 04-January 05
  • Location:The Netherlands

Posted 21 January 2006 - 07:41 PM

View Postkjactive, on Jan 21 2006, 11:08 AM, said:

....

This semilare code do not produce any trouble on my WinXP Service Pack 2 updated computer, GuiCreate before or after the 'create object' makes no difference, with or without freeing the component, with or without Guidelete still the same - I could not reproduce this troble in any conditions with the OWC 10 spreadsheet...
..


Hmm, that might be interesting. I tried it with Office 2000 and Office 2003 web components, but only under Windows XP Service Pack 1.

However, I fixed it anyway by removing my previous fix and reverting to the temporary fix. It's now included in beta version 3.1.1.103.


@Randallc (if you're reading this): Are you using Windows XP? If so, Windows XP servicepack 1 or 2 ?

@kjactive: About the question concerning your Com object editor; I will continue that in your topic in the Developers forum.


-Sven
0

#10 User is offline   randallc 

  • Mass Spammer!
  • PipPipPipPipPipPip
  • Group: Full Members
  • Posts: 1,902
  • Joined: 31-March 05

Posted 22 January 2006 - 12:24 AM

hi Sven
XP Pro SP2 auto update (although also a problem on Win 2000 machine)
The beta 103 works OK again for now, with thanks!
Randall
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users