Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using wxWidgets from a DLL

Tags:

wxwidgets

Is it possible to use wxWidgets from a DLL? I'm writing a plugin of sorts. (ACM for use in VirtualDub in this case, but I have other projects where I would like to do a similar thing)

All the docs that I come across discuss wxWidgets from the point of view of an executable. In most of these cases, I don't have access to the executable's source, but I'm writing various libraries for use in the process space of these executables.

Ideally, I would like to perform the minimum startup required to get wxWidgets up and running in a DLL. Which probably means performing some initialization, and starting a message pump, but without advertising an entry point for wxWidgets to use.

like image 627
FredFlinstone155 Avatar asked May 25 '26 02:05

FredFlinstone155


1 Answers

Using wxWidgets 2.9.2, all you need to do is the following:

wxApp::SetInstance(new wxApp());
new wxInitializer();

Then delete the wxInitializer when you are finished with it. Though I still cannot find this documented anywhere...

like image 163
FredFlinstone155 Avatar answered May 27 '26 20:05

FredFlinstone155



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!