Results 1 to 6 of 6

Thread: how to export dll with gui?

  1. #1
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to export dll with gui?

    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

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to export dll with gui?

    Quote Originally Posted by cutie.monkey View Post
    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

  3. #3
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to export dll with gui?

    i think exporting plugins is different from exporting dll with class functions. anyway thnks for your reply.. any help would be very much appreciated..

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to export dll with gui?

    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.

  5. #5
    Join Date
    Jul 2007
    Location
    BY.Minsk
    Posts
    90
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to export dll with gui?

    But, what problem ???
    for example:

    Qt Code:
    1. ....
    2. typedef string (CALLBACK* EXECSQL)(string, string, int);
    3. typedef int (CALLBACK* MSGBOX) (string, int);
    4.  
    5. class SCRIPTENGINE_EXPORT ScriptEngine
    6. {
    7. public:
    8.  
    9. ScriptEngine();
    10. ~ScriptEngine();
    11.  
    12. bool LoadScripts(string);
    13. void Clear();
    14. int CallFunction(string cFunction, ScriptVal sVal, string& cOut);
    15. void GetLastError(string &cError);
    16.  
    17. void SetPtrExecSql(EXECSQL pfnExecSql);
    18. void SetPtrMsgBox (MSGBOX pfnMsgBox);
    19.  
    20. private:
    21.  
    22. string m_Scripts;
    23. string m_Error;
    24.  
    25. };
    To copy to clipboard, switch view to plain text mode 

    scriptengine_global.h
    Qt Code:
    1. #ifndef SCRIPTENGINE_GLOBAL_H
    2. #define SCRIPTENGINE_GLOBAL_H
    3.  
    4. #include <QtGlobal>
    5.  
    6. #ifdef SCRIPTENGINE_LIB
    7. #define SCRIPTENGINE_EXPORT Q_DECL_EXPORT
    8. #else
    9. #define SCRIPTENGINE_EXPORT Q_DECL_IMPORT
    10. #endif
    11. #endif // SCRIPTENGINE_GLOBAL_H
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jul 2008
    Location
    Philippines
    Posts
    60
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to export dll with gui?

    Quote Originally Posted by Fastman View Post
    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.

Similar Threads

  1. PDF export of Dots: bugs?
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 14th June 2009, 14:52
  2. Library export macros on windows
    By jonks in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2009, 03:07
  3. How to export data from QTableView to Ms Excell
    By joseph in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2009, 14:19
  4. export and printing qwt plot
    By giusepped in forum Qwt
    Replies: 6
    Last Post: 17th December 2008, 07:04
  5. How to export resources in libraries on LINUX using Qt????
    By Shuchi Agrawal in forum Qt Programming
    Replies: 8
    Last Post: 1st June 2007, 10:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.