PDA

View Full Version : how to export dll with gui?



cutie.monkey
13th November 2009, 03:22
hi guys, im current having problem in exporting dll, e.i, i want to export my dll with gui and its class functions. currently i can export a dll like this:



#ifdef Q_WS_WIN
#define MY_DLL __declspec(dllexport)
#else
#define MY_DLL
#endif

extern "C" MY_DLL int sum(int a, int b)
{
return (a + b);
}


now my question is, how can i export dll with gui as well as its class functions? many thnks

yogeshgokul
13th November 2009, 04:24
now my question is, how can i export dll with gui as well as its class functions? many thnks
You can look into Qt-Plugins for this purpose.
http://doc.trolltech.com/4.5/plugins-howto.html#the-lower-level-api-extending-qt-applications
(http://doc.trolltech.com/4.5/plugins-howto.html#the-lower-level-api-extending-qt-applications)

cutie.monkey
13th November 2009, 09:15
i think exporting plugins is different from exporting dll with class functions. anyway thnks for your reply.. any help would be very much appreciated..

squidge
13th November 2009, 11:08
Is the code project article series by Mahmoud Komeily any good for you?

http://www.codeproject.com/KB/DLL/Dllfun.aspx

Admittingly it is aimed at MSVC, but it still might be helpful.

Fastman
13th November 2009, 12:23
But, what problem ???
for example:



....
typedef string (CALLBACK* EXECSQL)(string, string, int);
typedef int (CALLBACK* MSGBOX) (string, int);

class SCRIPTENGINE_EXPORT ScriptEngine
{
public:

ScriptEngine();
~ScriptEngine();

bool LoadScripts(string);
void Clear();
int CallFunction(string cFunction, ScriptVal sVal, string& cOut);
void GetLastError(string &cError);

void SetPtrExecSql(EXECSQL pfnExecSql);
void SetPtrMsgBox (MSGBOX pfnMsgBox);

private:

string m_Scripts;
string m_Error;

};

scriptengine_global.h


#ifndef SCRIPTENGINE_GLOBAL_H
#define SCRIPTENGINE_GLOBAL_H

#include <QtGlobal>

#ifdef SCRIPTENGINE_LIB
#define SCRIPTENGINE_EXPORT Q_DECL_EXPORT
#else
#define SCRIPTENGINE_EXPORT Q_DECL_IMPORT
#endif
#endif // SCRIPTENGINE_GLOBAL_H

cutie.monkey
14th November 2009, 02:19
But, what problem ???


currently i can export and call dll but without gui. now, what im trying to do is to add ui in my dll then call it from my application.