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. __declspec(dllimport)

__declspec(dllimport)

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 2 Posters 0 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.
  • _ Offline
    _ Offline
    _8086
    wrote on last edited by
    #1

    To be true, I have never used dllimport in my code while using a module. What's the actual use of it? No matter we use it or not, we are able to access the exported symbol right?

    ---------------------------- 286? WOWW!:-O

    L 1 Reply Last reply
    0
    • _ _8086

      To be true, I have never used dllimport in my code while using a module. What's the actual use of it? No matter we use it or not, we are able to access the exported symbol right?

      ---------------------------- 286? WOWW!:-O

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi 8086, Raymond Chen wrote a series about imports and exports[^] and its implementation history. Its an excellent read and I think you will enjoy it. Best Wishes, -David Delaune

      _ 2 Replies Last reply
      0
      • L Lost User

        Hi 8086, Raymond Chen wrote a series about imports and exports[^] and its implementation history. Its an excellent read and I think you will enjoy it. Best Wishes, -David Delaune

        _ Offline
        _ Offline
        _8086
        wrote on last edited by
        #3

        Thanks for the Pointer Randor!

        ---------------------------- 286? WOWW!:-O

        1 Reply Last reply
        0
        • L Lost User

          Hi 8086, Raymond Chen wrote a series about imports and exports[^] and its implementation history. Its an excellent read and I think you will enjoy it. Best Wishes, -David Delaune

          _ Offline
          _ Offline
          _8086
          wrote on last edited by
          #4

          Hi Randor, Just found this in MSDN : Using __declspec(dllimport) is optional on function declarations, but the compiler produces more efficient code if you use this keyword. However, you must use __declspec(dllimport) for the importing executable to access the DLL's public data symbols and objects. Note that the users of your DLL still need to link with an import library. Thanks for your reply.

          ---------------------------- 286? WOWW!:-O

          L 1 Reply Last reply
          0
          • _ _8086

            Hi Randor, Just found this in MSDN : Using __declspec(dllimport) is optional on function declarations, but the compiler produces more efficient code if you use this keyword. However, you must use __declspec(dllimport) for the importing executable to access the DLL's public data symbols and objects. Note that the users of your DLL still need to link with an import library. Thanks for your reply.

            ---------------------------- 286? WOWW!:-O

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Thats a fair but short description of dllimport. I apologize for sending you off to do your own research. Its just that sometimes I feel like I am answering the same questions over and over. Here is a thread from 2008 where dllimport was discussed. You can be surprised with what a well-formed codeproject search will find. http://www.codeproject.com/Messages/2431922/Re-import-library.aspx[^] Best Wishes, -David Delaune

            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