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

How to call a shared object(.so) from openoffice macro

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


Joined: 15 Nov 2005
Posts: 36
Location: gurgaon,india

PostPosted: Mon Jan 09, 2006 9:33 am    Post subject: How to call a shared object(.so) from openoffice macro Reply with quote

Hi all...

I had written a dialog box class in QT and had converted it into a shared object(.so) file,
I need to call this dialog from openoffice macro. How can I do this??

In windows I had done the same thing by putting the dialog in a DLL and calling it from
macro.

But in linux i dont know, can any one help me out.

Thanks.
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Mon Jan 09, 2006 10:27 am    Post subject: Reply with quote

if you want to call a so file you have to transform it as a component.
See my document chapter 13.
But in your case I think the problem is not so simple because of event manager : you will have two different windows managed by two different events manager... Try it but I am not sure you have before that to embed OOo in QT Windows system. It is possible as it is possible to embbed OOo in JSwing but I don't know how to do that.
It would be simpler to write your dialog in UNO/OOobasic or in UNO/C++.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
naveen_srma
General User
General User


Joined: 15 Nov 2005
Posts: 36
Location: gurgaon,india

PostPosted: Tue Jan 10, 2006 7:32 am    Post subject: Reply with quote

Hi,

Thanks for this great suggestion.
I am also thinking to use UNO/C++ coz current method is getting quite complicated.

I am going threw your chapters on how can link my code to openoffice.
Apart from that how can i learn using UNO/C++..if you can give some advice, that would be very useful.

I need to create some dialogs, handle documents, write on documents to give you an idea what I am trying to do.

Thanks.
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Jan 10, 2006 10:31 am    Post subject: Reply with quote

For UNO/C++ dialog see chapter 9 of my document.
Perhaps you can use OOoBasic for dialog and call OOoBasic from C++. I never make such way working but I think it is possible.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
naveen_srma
General User
General User


Joined: 15 Nov 2005
Posts: 36
Location: gurgaon,india

PostPosted: Thu Jan 12, 2006 7:34 am    Post subject: Reply with quote

Hi Serge,

Thats a great tutorial on dialogs...now that i can create a dialog in uno/c++, but one problem remains....On a menu click i need to call that c++ dialog.

You have written that we can call a macro from c++, but how can we call a dialog written in uno/c++ from macro.
coz only on menu event we need to call that dialog, is it possible?

Thanks.
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Thu Jan 12, 2006 8:20 am    Post subject: Reply with quote

It is depending on the OOo version.
Add-on is one solution : you have an example in SDK. I am not expert in the domain but I think you cannot choose the menu when using Add-on.
Other ways are probably described here :
Programmatically adding to existing Menus http://www.oooforum.org/forum/viewtopic.phtml?t=18491&highlight=
OO 2.0: where are menu files and macro library files saved? http://www.oooforum.org/forum/viewtopic.phtml?t=21709&highlight=
Context Menu Intercepting http://www.oooforum.org/forum/viewtopic.phtml?t=26669
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
naveen_srma
General User
General User


Joined: 15 Nov 2005
Posts: 36
Location: gurgaon,india

PostPosted: Mon Jan 30, 2006 10:32 pm    Post subject: Reply with quote

Hi,

Thats right that i can create a add-on or a component and can call a c++ module, but i want an easy way.
As im not creating any interface in c++, so i just want that i should call a shared object from macro and intercept the return value from it....thats it.

So isn't there a way that i can call a c++ programm and just know wht it returned.
Like on window we can call .dll's and access its return values.


Thanks.
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Jan 31, 2006 12:38 pm    Post subject: Reply with quote

I have no idea how it works under Windows. I am also surprised by this feature.
Under Linux I think it is not possible without a component. In fact you can implement in a component which works as an interface between OOoBasic and a dynamic library, but you have to create all the protocol.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Jan 31, 2006 12:45 pm    Post subject: Reply with quote

See also :
Calling .so libraries under Linux http://www.oooforum.org/forum/viewtopic.phtml?t=21052&highlight=
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Thu Feb 02, 2006 10:26 am    Post subject: Reply with quote

Here is an example where I construct an addIn to call an external shared .so library
This example is probably too complicated for your purpose because you only want a component. But it shows that this idea can work. You can propably program a more generic component which allow you to call every functions you need through only one method where the name of the function is a parameter and also the type of parameter and the number of parameters and so on. This problem is interesting to solve but probably complicated (very complicated if you haven't the .h (or .hxx) header file).
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
naveen_srma
General User
General User


Joined: 15 Nov 2005
Posts: 36
Location: gurgaon,india

PostPosted: Fri Feb 03, 2006 10:45 am    Post subject: Reply with quote

Thanks serge for such a great help...

I will go threw all this...lets see if i can grasp any thing out of it...
I hope im finding a way out to this problem...

thanks again....
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