ServiceManager and Writer GUI will not co-exist

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
esc
Posts: 5
Joined: Thu Jun 28, 2018 3:32 pm

ServiceManager and Writer GUI will not co-exist

Post by esc »

I've been searching for an answer for a couple of hours now but have had no luck.

Using VB6 and a fresh install of OO4.1.5 on Win 10 Pro 32bit.

After calling CreateObject("com.sun.star.ServiceManager"), I can not open the OO GUI (from a desktop shortcut, the Start menu, or clicking on a file that would open with OO). There are no errors, the GUI just does not open.
If I call "Desktop.Terminate", or close soffice.bin from the Task Manager, all of the OO GUI instances I had tried to open will suddenly appear.

When I have a Writer window open, calling CreateObject("com.sun.star.ServiceManager") fails with a "can't create Active X object" error.

It seems that the ServcieManager and the OO GUI can not both exist at the same time.

Any ideas why this might be?
OpenOffice 4.1.5 on Win 10 Pro 32 bit
esc
Posts: 5
Joined: Thu Jun 28, 2018 3:32 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by esc »

Lots of views, but no replies.
Did I post this in the right area?
Is this such a common occurrence that no one wants to bother answering again?
Or it it just that no one knows what might cause it?

If anyone can offer any insight into this issue, I would really appreciate it.

Thanks,
OpenOffice 4.1.5 on Win 10 Pro 32 bit
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by JeJe »

No-one will have the solution and I suspect few here will have VB6.

I have VB6 and OO4.1.2 on Windows 8 and calling CreateObject("com.sun.star.ServiceManager") from VB6 doesn't seem to cause any problems. All I can suggest is can you try it on another computer?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
esc
Posts: 5
Joined: Thu Jun 28, 2018 3:32 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by esc »

Thanks JeJe.
I'll give it a try.
OpenOffice 4.1.5 on Win 10 Pro 32 bit
Lobi.tlb
Posts: 2
Joined: Wed Jan 09, 2019 5:22 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by Lobi.tlb »

Hey there,

Im experiencing the same problem with a VB6 application. If the user has for example, calc open, on the line of code ServiceManager = CreateObject("com.sun.star.ServiceManager") there'll be an error about Activex not being able to do it, if the users closes down calc, then the program works just fine.

Also what you said, if during the code execution the user tries to open up calc, nothing will happen, untill the code finishes its execution, then it will pop up.

Is there a way to bypass this? To have a calc open and be able to work with OO for something else?
Last edited by Lobi.tlb on Wed Jan 09, 2019 7:46 pm, edited 1 time in total.
VB6 / OpenOoffice 4.1.5 On Windows 10
esc
Posts: 5
Joined: Thu Jun 28, 2018 3:32 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by esc »

I have not found any solution to this.
OpenOffice 4.1.5 on Win 10 Pro 32 bit
esc
Posts: 5
Joined: Thu Jun 28, 2018 3:32 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by esc »

I will however venture a WAG, completely unfounded with no evidence to back it up.

I suspect that:

A "service manager" instance is created when you manually open one of the OO applications.
Then, when you try to access the "service manager" through COM, you get a different instance.
Then the two instance fight over resources.

Again this is just a Wild A$$ Guess.
OpenOffice 4.1.5 on Win 10 Pro 32 bit
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by JeJe »

Both of you have Win10. On my Win8 machine this code in a VB6 form runs fine with a calc document already open and documents can be opened without a problem afterwards.

Code: Select all

Private Sub Form_Load()
Dim args()
  Set oServiceManager = CreateObject("com.sun.star.ServiceManager")
    Set oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop")
    Set oDocument = oDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args())
End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Lobi.tlb
Posts: 2
Joined: Wed Jan 09, 2019 5:22 pm

Re: ServiceManager and Writer GUI will not co-exist

Post by Lobi.tlb »

Thank you for your feedback.

There are some computers here that still have W7, i went ahead and tried it on one of them and you are correct, it works without issues even though calc is open. At least i know now its something related to the OS and might not be able to be fixed.
VB6 / OpenOoffice 4.1.5 On Windows 10
Post Reply