Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Exporting in a DLL

Exporting in a DLL

Scheduled Pinned Locked Moved C / C++ / MFC
questiontools
9 Posts 5 Posters 1 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    Hi all, Ok, this might be a stupid question but, here goes: Lets say you have a class in your DLL. And this class has a couple of functions that will be exported. Is it nessacery to export the class? I.E.

    #ifdef UTILITY_EXPORTS
    #define UTILITY_API __declspec(dllexport)
    #else
    #define UTILITY_API __declspec(dllimport)
    #endif
    
    class UTILITY_API test
    {
    public:
      int function1();
    };
    

    DEF File:

    LIBRARY Utility
    DESCRIPTION "Export Some Symbols."
    EXPORTS
    test @1
    function1 @2

    Thanx in advance

    The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

    P F 2 Replies Last reply
    0
    • P Programm3r

      Hi all, Ok, this might be a stupid question but, here goes: Lets say you have a class in your DLL. And this class has a couple of functions that will be exported. Is it nessacery to export the class? I.E.

      #ifdef UTILITY_EXPORTS
      #define UTILITY_API __declspec(dllexport)
      #else
      #define UTILITY_API __declspec(dllimport)
      #endif
      
      class UTILITY_API test
      {
      public:
        int function1();
      };
      

      DEF File:

      LIBRARY Utility
      DESCRIPTION "Export Some Symbols."
      EXPORTS
      test @1
      function1 @2

      Thanx in advance

      The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      you need to export that class, not its functions.

      Prasad Notifier using ATL

      P 1 Reply Last reply
      0
      • P prasad_som

        you need to export that class, not its functions.

        Prasad Notifier using ATL

        P Offline
        P Offline
        Programm3r
        wrote on last edited by
        #3

        Thanx for reply.. And one would be able to refernce those functions then, when exporting just the class?

        The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

        T 1 Reply Last reply
        0
        • P Programm3r

          Thanx for reply.. And one would be able to refernce those functions then, when exporting just the class?

          The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          have you only tried ? yes, when you export a class, you export everything within the class


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

          P 1 Reply Last reply
          0
          • P Programm3r

            Hi all, Ok, this might be a stupid question but, here goes: Lets say you have a class in your DLL. And this class has a couple of functions that will be exported. Is it nessacery to export the class? I.E.

            #ifdef UTILITY_EXPORTS
            #define UTILITY_API __declspec(dllexport)
            #else
            #define UTILITY_API __declspec(dllimport)
            #endif
            
            class UTILITY_API test
            {
            public:
              int function1();
            };
            

            DEF File:

            LIBRARY Utility
            DESCRIPTION "Export Some Symbols."
            EXPORTS
            test @1
            function1 @2

            Thanx in advance

            The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

            F Offline
            F Offline
            Frank K
            wrote on last edited by
            #5

            Hi, > Lets say you have a class in your DLL. And this class has a couple of functions that will be exported. Is it nessacery to export the class? To export a class from a dll is only possible from MFC-Class-DLL to MFC-Application. (or Microsoft Specific) To export a class isn't C++ standard. HTH Frank

            P J 2 Replies Last reply
            0
            • T toxcct

              have you only tried ? yes, when you export a class, you export everything within the class


              TOXCCT >>> GEII power

              [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

              P Offline
              P Offline
              Programm3r
              wrote on last edited by
              #6

              No, I haven't tried ! ... But thank you for the help. But now that I know what to do, I'll try. :)

              The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

              1 Reply Last reply
              0
              • F Frank K

                Hi, > Lets say you have a class in your DLL. And this class has a couple of functions that will be exported. Is it nessacery to export the class? To export a class from a dll is only possible from MFC-Class-DLL to MFC-Application. (or Microsoft Specific) To export a class isn't C++ standard. HTH Frank

                P Offline
                P Offline
                Programm3r
                wrote on last edited by
                #7

                Thanx for the reply ... I'll keep that in mind.

                The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

                1 Reply Last reply
                0
                • F Frank K

                  Hi, > Lets say you have a class in your DLL. And this class has a couple of functions that will be exported. Is it nessacery to export the class? To export a class from a dll is only possible from MFC-Class-DLL to MFC-Application. (or Microsoft Specific) To export a class isn't C++ standard. HTH Frank

                  J Offline
                  J Offline
                  Jorgen Sigvardsson
                  wrote on last edited by
                  #8

                  Frank K wrote:

                  To export a class from a dll is only possible from MFC-Class-DLL to MFC-Application.

                  Wrong. You can export a class from any type of DLL. Whether you can use that class or not, depends entirely on the compiler/linker you use to link to the DLL.

                  -- Mit viel Oktan und frei von Blei, eine Kraftstoff wie Benziiiiiiin!

                  P 1 Reply Last reply
                  0
                  • J Jorgen Sigvardsson

                    Frank K wrote:

                    To export a class from a dll is only possible from MFC-Class-DLL to MFC-Application.

                    Wrong. You can export a class from any type of DLL. Whether you can use that class or not, depends entirely on the compiler/linker you use to link to the DLL.

                    -- Mit viel Oktan und frei von Blei, eine Kraftstoff wie Benziiiiiiin!

                    P Offline
                    P Offline
                    Programm3r
                    wrote on last edited by
                    #9

                    Thanx Jörgen Sigvardsson, for clearing that one up.... :)

                    The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups