wxPluginManager and wxPluginLibrary Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 469
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Post by New Pagodi »

farocam wrote:THANKS ALOT!! But what about MVS6 settings? How must we compile de wxWidgtes libraries and how must we compile this proyect that you sent?
Is nmake not working? Here are some wiki pages that might or might not be helpful

Compiling Using MSVC On The Commandline

Microsoft Visual C++ .NET Setup Guide

MSVC Setup Guide (see also MSVC Setup Guide For Wx 2.5.4 And Later)

User's guide for VC++ 6.0
farocam
Knows some wx things
Knows some wx things
Posts: 44
Joined: Mon Mar 13, 2006 7:07 pm
Location: Montevideo, Uruguay

Post by farocam »

What I meant is how to compile and/or configure wxWidgets so that the DLL calling will work. What option do I need ?

Win32 Release DLL
Win32 Debug DLL
Win32 Release Unicode DLL
Win32 Debug Unicode DLL

Which of these options builds a DLL version of wxWidgtes?
VonGodric
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Jan 30, 2005 9:31 pm
Contact:

Post by VonGodric »

I messed around with plugins a while ago as well.

Here's the src in cvs of it if anyone is interested. It's commented in most parts...

http://fbide.cvs.sourceforge.net/fbide/FBIde/fbipe/
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 469
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Post by New Pagodi »

farocam wrote:What I meant is how to compile and/or configure wxWidgets so that the DLL calling will work. What option do I need ?

Win32 Release DLL
Win32 Debug DLL
Win32 Release Unicode DLL
Win32 Debug Unicode DLL

Which of these options builds a DLL version of wxWidgtes?
Any of those will work. Win32 Release DLL is probably the simplest.
farocam
Knows some wx things
Knows some wx things
Posts: 44
Joined: Mon Mar 13, 2006 7:07 pm
Location: Montevideo, Uruguay

Post by farocam »

I DID IT!!! I made it work!! Thanks New Pagodi!!! Thanks UpCase!!!! I compiled everything, had linking errors, added the settings one by one and came to a point that it compiled and linked without errrors, but, when I clicked in the Doit button, I got this message:

Couldn't find symbol 'CreatePlugin' in a dynamic library (error 127: the specified procedure could not be found.)

I messed around with the seetings but nothing seemed to work. I switched back to the original settins and same error. But I saw New Pagodi's last answer:
Any of those will work. Win32 Release DLL is probably the simplest.
And so I switched to Win32 Release in the settings panel. MAGIC, no errors, no warnings and the plug in worked perfectly!!!

"Perform some action", " I would if I could", etc...

THANKS EVERYBODY!!!
Fabian
User avatar
T-Rex
Moderator
Moderator
Posts: 1249
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex »

Although it took me some time, I compiled a small example host and plugin. You may have a look at it here
htt://www.upcase.de/stuff/wxPlugin.zip
Note that this example uses a static wxWidgets library using the static version of the C runtime.
upCASE, nice example but I notices some strange behaviour.. it seems that main window of first loaded plugin does not handle paint event (you can see this bug/weird behavior when resizing the window)

Image

PS: Second, third and other next loaded plugin windows work correctly. Only first loaded window has such behaviour
jvc
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Aug 14, 2007 11:12 am

Post by jvc »

Hi,

i am trying to build the wxPlugin Sample which upCASE posted here. I tried every constellation regarding wxWidgets and the sample project, but i always end up with one linker error.

Code: Select all

HostApp.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxStringData::Free(void)" (?Free@wxStringData@@QAEXXZ)
I am using wxWidgets Version 2.8.6. Has anybody achieved to build the sample with this version?
I appreciate any hint.

Thanks in advance, regards Joe.
mgilioli
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Dec 20, 2007 10:59 am
Location: Italy
Contact:

Post by mgilioli »

Hi to all,
this post is only to thank everyone was involved in this discussion. Thanks to the provided information I have been able to improve my software with a complete plugin architecture, so it is now really complete.
Thank you very much guys!

Marco
Marco
DGTech Engineering Solutions
www.dg-tech.it
User avatar
T-Rex
Moderator
Moderator
Posts: 1249
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex »

mgilioli, could you provide the source code of skeleton application with plugin which you are using? This will help other people here to make less mistakes in future.
mgilioli
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Dec 20, 2007 10:59 am
Location: Italy
Contact:

Post by mgilioli »

Hi T-Rex,
here you can find a simple project involving the use of Plugins:
www.dg-tech.it/download/Plugin SDK.zip

The minimal folder is the application which uses the plugins, while Digital Input plugin folder reports an example of plugin.
Most probably if will be necessary to change some include and library directory in the project to make them working correctly.

The project has been developed under Microsoft Visual Studio 7.1, the wxWidget version is the 2.8.2 and it has been compiled in Release DLL mode.
Actually, as said in this discussion, using dynamic libraries seems to be the only way to use plugins in a safety way.

Let me know if someone has troubles in using the provided example.

Ciao
Marco
Marco
DGTech Engineering Solutions
www.dg-tech.it
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Post by Widgets »

Two items in relation to upCase's plugin example.
- for those who want to use it with dynamically linked wxWidgets, please see
http://forums.wxwidgets.org/viewtopic.php?t=19036

- the other issue that came up for me after making the example work, is that the IMPLEMENT_LDR_PLUGIN macro - after I removed the part which causes the problem for dynamically linked plugins, still causes a memory leak since the macro allocates 'name' which is not delete'd anywhere.

I'm sure with time I'll figure out where to release this variable but for now I'll live with it, since I know where and why the leak comes about,.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
Post Reply