EOleException on Close Form

Discussion forum for PivotCube VCL users. Common questions. Bug and problem reports

Moderator: Alex Zencovich

EOleException on Close Form

Postby sn00py » Mon Mar 05, 2007 10:03 am

Hi, i just got an error report from a customer ...
i think he closed the form and the pivot cube wan't ready?

how can i prevent this? (Force the cube to close, or wait for the cube be finsihed ?)

Code: Select all
Stack List
Stack list, generated 05.03.2007 09:48:22
[0112E9E8] PivotMap_SRC.TPivotMap.SetActive (Line 3337,"PivotMap_SRC.pas" + 128) + $2D
[00407A49]         System.@CheckAutoResult + $11
[0112E9E8] PivotMap_SRC.TPivotMap.SetActive (Line 3337,"PivotMap_SRC.pas" + 128) + $2D
[01129CEF] PivotMap_SRC.TPivotMap.Destroy (Line 2089,"PivotMap_SRC.pas" + 2) + $4
[00430C5A]         Classes.TComponent.DestroyComponents + $46
[00430A5F]         Classes.TComponent.Destroy + $47
[004711C7]         Controls.TControl.Destroy (Line 3158,"Controls.pas" + 15) + $7
[0040448C]         System.TObject.FreeInstance + $C
[00404896]         System.@ClassDestroy + $2
[00434E2A]         Graphics.TBrush.Destroy (Line 1815,"Graphics.pas" + 1) + $13
[00474875]         Controls.TWinControl.Destroy (Line 5345,"Controls.pas" + 21) + $7
[00462690]         Forms.TScrollingWinControl.Destroy (Line 2024, "Forms.pas" + 3) + $7
[011F6944] frame_CubeInline.TframeCubeInline.Destroy (Line 181, "frame_CubeInline.pas" + 5) + $7
sn00py
Developer
 
Posts: 21
Joined: Tue Sep 12, 2006 7:50 am

Postby AlexZencovich » Mon Mar 05, 2007 10:25 am

Hi,

It seems like error was generated on line with enxt code (I do not sure because I do not know whiich version you have used to build application)

Cube.Intf.DestroyMap(Self);

At least there is only one line which may call CheckAutoResult. There is call to zCube.dll to clear internal data. I have no idea why error was generated. zCube.dll is in-process server so even on application close, execution will not processed until code in zCube.dll finished. But if zCube.dll was unloaded before it will generate error, of course.

Is that error random or there is constant, reproducible error? Does your application use threads?
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby sn00py » Mon Mar 05, 2007 10:37 am

yes this is the line with the error :

Code: Select all
    if FActive <> Value then
        begin
        FActive := Value;
        Cube.Intf.DestroyMap(Self);           <<<<< this is line 3337
        for i := 0 to FToolBarLinks.Count - 1 do


i use the define _NONDLL to compile the application.

The user has closed an winwod (which was freed) this window uses a frame which has a Cube on it. The application wasn't closed.

i don't use the zCube.dll.
I use threads, but noit in these section of the application ...

maybe the user has closed the form, before the cube was finished loading?


Where do i see the actuel version i am using? Is it included into a pas file?
sn00py
Developer
 
Posts: 21
Joined: Tue Sep 12, 2006 7:50 am

Postby AlexZencovich » Mon Mar 05, 2007 11:30 am

1.
I do not think there was problem with too fast closed window. regardless on speed, if you not place PivotCube in separate thread, execution point will move step by step. If PivotCube will require more ime to close it will just take more time between user click and form closed.
Especially if you use nonDLL version it mean there are no separate OLE server so stack list should show you procedures called after DestroyMap (located in Cube.pas)
Because execution point stops on routine call, I think exception was generated by System.CheckAutoResult.

2.
Potentially user cannot close form until cube loading not finished (cursor no change shape back to arrow) because there internal process which will not handle external Windows messages (no Application.ProcessMessages calls)

So we have 3 possible reasons for error
1. Cube is nil or uninitialized
2. Cube.Intf is nil or uninitialized
3. OS fault

It there is random exception, I think there was fault in Windows. It there is regular exception then we should find situation which may activate situatons 1 and 2

3.
You may see version in pivotcube.res (near the end of file)
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby sn00py » Mon Mar 05, 2007 11:47 am

yes, its reproducable, everytime i close the window while the cube is loading i get this EOleException.

The version from the res file :

Code: Select all
P r o d u c t V e r s i o n   7 . 4 . 1 . 1
F i l e V e r s i o n     7 . 4 . 1 . 1 0 2


i am not useing a thread, and i compiled with the _NONDLL define
sn00py
Developer
 
Posts: 21
Joined: Tue Sep 12, 2006 7:50 am

Postby AlexZencovich » Mon Mar 05, 2007 11:58 am

Ok. I will check for possible problem.
You may use TPivotCube.OnBeforeLoad/OnAfterLoad to prevent form close while loading not finished
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby sn00py » Mon Mar 05, 2007 1:15 pm

AlexZencovich wrote:Ok. I will check for possible problem.
You may use TPivotCube.OnBeforeLoad/OnAfterLoad to prevent form close while loading not finished


i just tried it, but the events aren't called in my application ....
sn00py
Developer
 
Posts: 21
Joined: Tue Sep 12, 2006 7:50 am

Postby AlexZencovich » Mon Mar 05, 2007 2:03 pm

There is code which fire these events

if Assigned(FOnBeforeLoad) then
begin
FOnBeforeLoad(Self,allow);
if not allow then
Exit;
end;

and

if Assigned(FOnAfterLoad) then
FOnAfterLoad(Self);


If you build cube(PivotCube.Active := True) instead of load it from saved file(PivotCube.LoadFromXXXXX), use OnBeforeBuild and OnAfterBuild instead
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am


Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 1 guest

cron