| View previous topic :: View next topic |
| Author |
Message |
rvveelen General User

Joined: 06 Jul 2007 Posts: 9
|
Posted: Fri Jul 20, 2007 5:58 am Post subject: terminate gives error |
|
|
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 |
|
 |
jwr OOo Advocate


Joined: 06 Sep 2006 Posts: 367 Location: Germany
|
|
| Back to top |
|
 |
rvveelen General User

Joined: 06 Jul 2007 Posts: 9
|
Posted: Fri Jul 20, 2007 9:16 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Fri Jul 20, 2007 11:49 am Post subject: |
|
|
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 |
|
 |
rvveelen General User

Joined: 06 Jul 2007 Posts: 9
|
Posted: Fri Jul 20, 2007 4:20 pm Post subject: |
|
|
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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Fri Jul 20, 2007 11:18 pm Post subject: |
|
|
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
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
______
Bernard |
|
| Back to top |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sat Jul 21, 2007 12:48 am Post subject: |
|
|
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 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 |
|
 |
rvveelen General User

Joined: 06 Jul 2007 Posts: 9
|
Posted: Sat Jul 21, 2007 2:50 am Post subject: |
|
|
Thanks!
I will have a shot at it monday at the office. But thanks for looking into it so closely!
Ronald |
|
| Back to top |
|
 |
rvveelen General User

Joined: 06 Jul 2007 Posts: 9
|
Posted: Wed Jul 25, 2007 7:27 am Post subject: |
|
|
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 |
|
 |
|