Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    C++ Gurus
    3
    3
    2811
    Loading More Posts
    • 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
      MonalisaKalla last edited by

      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 Reply Quote 0
      • G
        giesbert last edited by

        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 Reply Quote 0
        • G
          goetz last edited by

          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 Reply Quote 0
          • First post
            Last post