Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. [Moved] dynamic linking(late bind) and pointer to member function

[Moved] dynamic linking(late bind) and pointer to member function

Scheduled Pinned Locked Moved C++ Gurus
3 Posts 3 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MonalisaKalla
    wrote on last edited by
    #1

    I want to dynamically link the dll and then import a class from the dll written in VC ++ to the QT.

    class written in VC++:

    @
    class _delspec(dllexport) A
    {
    FunA();
    static void FunB();
    }
    @

    I want to import of the above class in my QT application and want to create object of this class and call the functions.Also i want to call the static member functions of the class into my QT application.

    I do not want to include the header file where i have declared this class, in my QT application because the class have dependeny on lot of other classes, how can i achieve this?
    Plwease provide your inputs.

    EDIT: please surround code by @-tags, gerolf

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      You will not achieve this :-)
      It's C++, not Qt specific.

      If you want to use late binding, you can only use C-exported functions, not classes.

      There is one thing that is possible:

      Use a creator pattern.

      create a c-function (that has a C-export) which creates a class.
      The class itself must implement a public interface , where the header must be used on both sides.

      No other chance.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        Moved to the C++ Gurus forum, as it's not Qt specific.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved