Hi All,<br><br>I have an existing QT App that I want to integrate into Lazarus. To test this I have created an dll in QT that creates a QCheckbox.  I am able to load the checkbox onto a widget in a QT application. However, with Lazarus I get "Must construct a QApplication before a QPaintDevice". <br>
<br>I am using Lazarus QT 0.9.26.2 and I have QT 4.5 installed. My LCL widgetset is set to QT in the compiler options and I am able to run all the examples for the V1.68 FPC binding.<br><br>There are two exports in my DLL (TestDLL.dll):<br>
   extern "C" __declspec(dllexport) int GetNum();
<p style="margin: 0px; text-indent: 0px;">   extern "C" __declspec(dllexport) int QCheckBoxDDL_create(int parent);</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
In Lazarus I have the following import functions:</p><p style="margin: 0px; text-indent: 0px;">    function GetNum():longint cdecl; external TestDLL name 'GetNum';<br>    function QCheckBoxDDL_create(WidgetH: QWidgetH):QWidgetH cdecl; external TestDLL name 'QCheckBoxDDL_create'; </p>
<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">The functions are called by:</p><p style="margin: 0px; text-indent: 0px;">   ShowMessage(inttostr(GetNum()));</p><p style="margin: 0px; text-indent: 0px;">
<br></p><p style="margin: 0px; text-indent: 0px;">   MyHandle:=TQtWidget(panel1.Handle).Widget;<br>  

DLLWidget:= QCheckBoxDDL_create(MyHandle);<br></p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">I can call GetNum() without a problem. However when I call QCheckBoxDDL_create I get "Must construct a QApplication before a QPaintDevice"<br>
</p><br>From my understanding I gather that the Lazarus app would create a QApplication when the LCL is set to QT. <br>Why does the DLL not see it and how do I 'help' the DLL to see it ?<br>Is it a good idea to create another QApplication object within the DLL?<br>
<br>Thanks in Advance,<br>Deon<br><br><br>