Owen
Owen

Reputation: 209

Can I run a QT or wxWidgets GUI from a STA dll?

I am currently evaluating options for porting an existing unmanaged C++ codebase to use a new GUI toolkit. QT and wxWidgets both seem like a good fit so far as they have a strong object model. The application is only targeted at Windows machines, but a platform independent solution would be good to have.

In the future this code may need to be converted into a DLL restricted to a Single Threaded Apartment (STA). Is this a un-avoidable problem for either of these toolkits? Are there any other toolkits that I should be considering?

I know the DLL would be loaded by an application acting as a Multi Threaded Apartment (MTA). Unfortunatly, this application may also be loading other DLLs that may have their own GUIs which could be using other or similar toolkits not under my control. Are either of these toolkits more suited to these restrictions? I understand from other posts that starting a QT GUI from a DLL is possible, but not very flexible. However, I don't know if the same is true for wxWidgets, or if the STA restriction has any impact for either toolkit.

Upvotes: 0

Views: 229

Answers (1)

VZ.
VZ.

Reputation: 22688

wxWidgets doesn't care about the apartment it's loaded into. The only COM interfaces it uses are the shell ones (e.g. IFileDialog) which should work in any apartment. So I just can't imagine having any new problems due to this. But maybe I just don't have a good enough imagination, of course...

Upvotes: 2

Related Questions