PDA

View Full Version : QT dll questions



maybnxtseasn
7th March 2012, 02:57
If i make a QT dll i have the following 2 questions

1.) Is there a depedency i will need to install or distribute with my dll in order for the user to load the dll so it can load a window?

2.) How do i execute the code in the dll? with a simply loadlibrary call?( that is if im on windows )

ChrisW67
7th March 2012, 04:23
1.) Is there a depedency i will need to install or distribute with my dll in order for the user to load the dll so it can load a window?

Yes, any Qt library or plugin that the DLL depends on. It will be at least QtCore4.dll, QtGui4.dll and probably much more.


2.) How do i execute the code in the dll? with a simply loadlibrary call?( that is if im on windows )
You can link your other program against the library and rely on Windows to implicitly load the DLL and make its content available.

Or, you can load it yourself using LoadLibrary. LoadLibrary does not execute any user code in the library other than DllMain, which Qt tends to hide from you. To do anything useful with the DLL after this will require using GetProcAddress.

Or, if your library is an ActiveX control you use it like any other registered control.

high_flyer
7th March 2012, 11:14
1.) Is there a depedency i will need to install or distribute with my dll in order for the user to load the dll so it can load a window?
Another option is to built Qt as a static lib, then you link it to your application, and you don't have any other Qt related dependencies.
The down side of this approach is the size of the exe, and it wont scale with future Qt versions.