OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

terminate gives error

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
rvveelen
General User
General User


Joined: 06 Jul 2007
Posts: 9

PostPosted: Fri Jul 20, 2007 5:58 am    Post subject: terminate gives error Reply with quote

look at this function:
http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XDesktop.html#terminate

When I try to terminate my application, I get an C++ error:

Microsoft Visual C++ Runtime Library
Runtime Error!

Program: path...\program\soffice.BIN

R6025
- pure virtual function call

I have closed all documents, but soffice.exe and soffice.bin are still running on my taskmanager. If I have a document open everything works just fine.

any idea why and how to handle this?

Thanks in advance!
Back to top
View user's profile Send private message
jwr
OOo Advocate
OOo Advocate


Joined: 06 Sep 2006
Posts: 367
Location: Germany

PostPosted: Fri Jul 20, 2007 6:14 am    Post subject: Reply with quote

Did you check a search for R6025 ?

http://www.oooforum.org/forum/viewtopic.phtml?t=36558&highlight=r6025

reports a pathname with too many characters. Please try to use a shorter name.

Regards -Hans-
_________________
Windows 2K, OOo-2.3.0, MS-IE-6.0, Firefox-1.0.4, MS Office 97,
Say NO to MS OpenXML: http://www.noooxml.org/petition
Back to top
View user's profile Send private message
rvveelen
General User
General User


Joined: 06 Jul 2007
Posts: 9

PostPosted: Fri Jul 20, 2007 9:16 am    Post subject: Reply with quote

Hi

Yes, I saw that one, the problem is it is not when I am opening a document or something. It is when i try to terminate the desktop.

Hope you can help me with that Wink
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Fri Jul 20, 2007 11:49 am    Post subject: Reply with quote

Hi,
In which language is your application ?

I came into this Error with VB2005, automating OpenOffice from COM.
It is due to variables still holding some reference to OpenOffice objects.

If you are using VB, I can explain more.
______
Bernard
Back to top
View user's profile Send private message Visit poster's website
rvveelen
General User
General User


Joined: 06 Jul 2007
Posts: 9

PostPosted: Fri Jul 20, 2007 4:20 pm    Post subject: Reply with quote

Hi

It is xbase++ (not to familiar I guess) but it is essentialy the same as VBscript. It also uses a Com object.

If you could explain more I would be very greatful.

Ronald
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Fri Jul 20, 2007 11:18 pm    Post subject: Reply with quote

Hi,

As I said I got R6025 with VB 2005 (also called VB.NET). I got it also with VBA but easier to get rid of. I never got it with VBScript, nor with Delphi.

I got some ideas from the web page
http://www.xtremevbtalk.com/showthread.php?t=160433
This very interesting article shows how difficult it may be, even when calling a MS application.

In my case this is not enough, depending on what I did with OpenOffice. After many tests I currently have this solution:

- clear all your variables that still contain a reference to an OpenOffice object. In VB this means setting the variable to Nothing.
- run the garbage collector as explained in the article (I don't know if there is a command for this in your language)

- now you don't have any variable with an OpenOffice object. But you have to get one to close OpenOffice!
- create a fresh OpenOffice object from com.sun.star.ServiceManager
- create a fresh desktop object from service com.sun.star.frame.Desktop
- desktop.terminate
- clear these two variables.

Well, sometimes I still get R6025 Evil or Very Mad
VB 2005 has two kinds of compilation : one when you work with the IDE, one for the release of your software. Running the release code, I have not yet found R6025. I suspect the debugging code holds some other variables.

Hope this helps Rolling Eyes
______
Bernard
Back to top
View user's profile Send private message Visit poster's website
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Sat Jul 21, 2007 12:48 am    Post subject: Reply with quote

Hi again,
After sending my message above I did some runs with my VB code, shunting the special release to reproduce the R6025 error.

No error message Rolling Eyes on my various test examples, even with simply setting variables to Nothing.
What has changed ? I am now working on a brand new computer. Same OS as before (Win XP Home), same applications. But of course I had to install them on the new computer.

So the problem may be triggered by Windows Registry inconsistency or/and OpenOffice installation problems.

Concerning the Registry, repair it with a suitable software : MaceCraft, RegistrySmart, RegSweep...

Concerning OpenOffice I found that in some cases OpenOffice repair does not reset correctly all Registry keys used for access by COM.

In the Registry editor (regedit.exe) do a Ctrl-F to search with these parameters :
- value 82154420 (this is the first numbers of the key for OpenOffice)
- check : Look into... Key
- uncheck all other checkboxes.
There are several appearances of this key.
In each key branch, open section LocalServer32. Verify that the called program address is correct, change the value if not. In the case of OpenOffice 2.2.x you should have :
Code:
C:\Program Files\OpenOffice.org 2.2\program\soffice.exe -nodefault -nologo

Hope this helps (also)
______
Bernard
Back to top
View user's profile Send private message Visit poster's website
rvveelen
General User
General User


Joined: 06 Jul 2007
Posts: 9

PostPosted: Sat Jul 21, 2007 2:50 am    Post subject: Reply with quote

Thanks!

I will have a shot at it monday at the office. But thanks for looking into it so closely!

Ronald
Back to top
View user's profile Send private message
rvveelen
General User
General User


Joined: 06 Jul 2007
Posts: 9

PostPosted: Wed Jul 25, 2007 7:27 am    Post subject: Reply with quote

The problem actually was none of the above.

What I did was opening a document edit it and then save it to another location. After closing the documents, the old location was still in the memory of open office, causing it to crash *sometimes*.

What I had to do (what I always should do) is calling a dispose on the document. This will free the document from the desktop it is called from.

so dispose was the magic word.

Thanks for your help! and this topic could be closed IMHO
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group