Questins about dll or so plugins and wxapp Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
basile
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Feb 28, 2008 10:21 am

Questins about dll or so plugins and wxapp

Post by basile » Fri Jul 31, 2009 12:54 pm

HI,

I'm still new to wxwidgets. I know it's possible to create some kind of plugins for a wx application. I found some documentation in the wiki but not what I was expecting.

My question is:

Is it possible to load dll or so plugins when my wx application is staic build?

I mean, I want to create a wx application that is build with mingw with static, unicode, release. Will I be able to load some plugins compiled as dll or so, with my application?

Thanks in advance!
MS Windows SP3 / Debian UNSTABLE/ WX2.9.10

tan
Moderator
Moderator
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Re: Questins about dll or so plugins and wxapp

Post by tan » Sat Aug 01, 2009 7:29 am

Hi,
basile wrote:HI,

I'm still new to wxwidgets. I know it's possible to create some kind of plugins for a wx application. I found some documentation in the wiki but not what I was expecting.

My question is:

Is it possible to load dll or so plugins when my wx application is staic build?

I mean, I want to create a wx application that is build with mingw with static, unicode, release. Will I be able to load some plugins compiled as dll or so, with my application?
do you mean the plugins use wxwidgets also?
Yes, it is possible, but with essential restrictions about using wxwidgets options. E.g. you will not be able to transfer from the app to plugin (and back) some wx objects.
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10

basile
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Feb 28, 2008 10:21 am

Post by basile » Tue Aug 04, 2009 9:56 am

do you mean the plugins use wxwidgets also?
Yes both will use WxWidgets. I mean the main application will be mad with wxAUI, and the pugins will be some object library or some export tools.

Let me explain you: This software is a CAD tools for designing elctronic layout for eyelets, pcb and point to point board.

This main app will use wxAUI for HIM with wxArt2d or wxOGL.

The libraries will be component libraries (resistors, caps, transistors, etc...). One library will embed images in the appropriate format. So depending the library located in a specific directory, the main wxApp will load the plugin/library.
Another kind of plugins are tools. So the user will load a plugin to export a layout into a pdf document in which the Bill of Material, some texts and comments and the picture of the layout will be present.



So I hope nothing will be a problem for what I want to do!
Yes, it is possible, but with essential restrictions about using wxwidgets options. E.g. you will not be able to transfer from the app to plugin (and back) some wx objects.
Do you know where I can find those limitations? I want to check if something will be impossible to do...

Thanks anyway!
MS Windows SP3 / Debian UNSTABLE/ WX2.9.10

tan
Moderator
Moderator
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan » Tue Aug 04, 2009 11:41 am

basile wrote:
do you mean the plugins use wxwidgets also?
Yes both will use WxWidgets. I mean the main application will be mad with wxAUI, and the pugins will be some object library or some export tools.
OK, what the reason to use static wx linkage in that environment?
First, it is ineffective from the point of view of the code size and speed of program and plugins loading. Secondly, you receive a heap of a headache at the organization of interaction of objects in the application and plugins. The most simple example: modal dialog called in a plugin will not be modal for the frame in the main application and such "reefs" can be very much.
basile wrote: Let me explain you: This software is a CAD tools for designing elctronic layout for eyelets, pcb and point to point board.

This main app will use wxAUI for HIM with wxArt2d or wxOGL.

The libraries will be component libraries (resistors, caps, transistors, etc...). One library will embed images in the appropriate format. So depending the library located in a specific directory, the main wxApp will load the plugin/library.
Another kind of plugins are tools. So the user will load a plugin to export a layout into a pdf document in which the Bill of Material, some texts and comments and the picture of the layout will be present.



So I hope nothing will be a problem for what I want to do!
Yes, it is OK. But i strongly recommend to build the app and plugins with dynamic wx libs.
basile wrote:
Yes, it is possible, but with essential restrictions about using wxwidgets options. E.g. you will not be able to transfer from the app to plugin (and back) some wx objects.
Do you know where I can find those limitations? I want to check if something will be impossible to do...
These limitations concern only for static build (it was discussed in the forum and wx-devs mailing list, unfortunatly, i do not remember full references). Use dynamic build for plugins architectures and all things will be much easier :)
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10

basile
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Feb 28, 2008 10:21 am

Post by basile » Tue Aug 04, 2009 12:46 pm

ok! So to conclude, this is more simple to use dynamic builds when someone tries to create a main application which might use plugins. Am I right?

My idea was :
1 - to create a static main application for Linux and Windows (just to avoid depency towards system libraries, GTK+ libs mess...)
2 - to load plugins to avoid a complete regeneration of the main application each time a library component is updated, or each time a new tool is created.

So if I want to keep the feature #2, I have to build the main application with dynamic build. If someone has a better idea than me for having both features for my project, I will be very thankfull.

Anyway, thanks tan for your answer, I really appreciate your advice. I will close this topic after everything will be clear for me.
MS Windows SP3 / Debian UNSTABLE/ WX2.9.10

Post Reply