Page 1 of 1

ServiceManager and Writer GUI will not co-exist

Posted: Thu Jun 28, 2018 4:18 pm
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?

Re: ServiceManager and Writer GUI will not co-exist

Posted: Mon Jul 02, 2018 9:10 pm
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,

Re: ServiceManager and Writer GUI will not co-exist

Posted: Mon Jul 02, 2018 10:50 pm
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?

Re: ServiceManager and Writer GUI will not co-exist

Posted: Mon Jul 02, 2018 10:58 pm
by esc
Thanks JeJe.
I'll give it a try.

Re: ServiceManager and Writer GUI will not co-exist

Posted: Wed Jan 09, 2019 5:26 pm
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?

Re: ServiceManager and Writer GUI will not co-exist

Posted: Wed Jan 09, 2019 6:49 pm
by esc
I have not found any solution to this.

Re: ServiceManager and Writer GUI will not co-exist

Posted: Wed Jan 09, 2019 6:54 pm
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.

Re: ServiceManager and Writer GUI will not co-exist

Posted: Wed Jan 09, 2019 7:10 pm
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

Re: ServiceManager and Writer GUI will not co-exist

Posted: Wed Jan 09, 2019 7:19 pm
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.