Results 1 to 3 of 3

Thread: dll again..

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    33
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default dll again..

    guys i want to create a .dll file that has its own window so that if i call the dll it will create its own window (like eula license for example)..

    im having a bit of trouble doing it, my question is how can i export the object (Dialog), for example just show the ui in a single function without class

    i can export functions using extern "C" Q_DECL_EXPORT, next question is how can i export the class::functions, if i export the class can i already access its functions? how? should i access the classname::functionname or functionname only?

    note:"im avoiding to use the #include mydll.h i want my dll to be independent, i only call the dlls"

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: dll again..

    Quote Originally Posted by triperzz View Post
    i can export functions using extern "C" Q_DECL_EXPORT, next question is how can i export the class::functions, if i export the class can i already access its functions? how? should i access the classname::functionname or functionname only?
    It's not that easy, if you don't want to use a header file. The exact name depends on name mangling scheme of your compiler. You can use Dependency Walker to look up the symbols.

    Quote Originally Posted by triperzz View Post
    im avoiding to use the #include mydll.h i want my dll to be independent, i only call the dlls"
    The header file tells the compiler how the class looks like and this make accessing it much easier. Just make sure that the header contains only the interface.

  3. #3
    Join Date
    Oct 2006
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 3 Times in 2 Posts

    Default Re: dll again..

    What you can do is create base class (abstract) - something like MyPlugin, and then create implementations of the things you want in .dll using MyPlugin as base class. MyPlugin would have at least two exported functions - one for creating object of type MyPlugin, another for destroying it. Then, you could manualy load .dll using QLibrary, and use custom implementations of your 'plugins'... you would only need to include MyPlugin.hpp wich is abstract. If this doesn't make much sense to you, maybe I'll try to do some code examples next time?

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.