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. Need your help

Need your help

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 4 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.
  • H Offline
    H Offline
    Hungry Developer
    wrote on last edited by
    #1

    Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.

    M C R 3 Replies Last reply
    0
    • H Hungry Developer

      Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.

      M Offline
      M Offline
      Mukesh Kumar
      wrote on last edited by
      #2

      There are various tutorials on net about dll. try to use Google...:) BTW extern "C" is used with __declspec to calling methods from Dll compiled in 'C'. see this link: http://msdn.microsoft.com/en-us/library/ys435b3s(VS.80).aspx[^]

      Mukesh Kumar Software Engineer

      modified on Saturday, May 10, 2008 1:46 AM

      1 Reply Last reply
      0
      • H Hungry Developer

        Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #3

        extern "C" makes the function exported using C-like mangling scheme (instead of C++ one), this is, for instance, the standard for Win32 API. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        1 Reply Last reply
        0
        • H Hungry Developer

          Hi, In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype. Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function. Thanks in advance.

          R Offline
          R Offline
          Rajkumar R
          wrote on last edited by
          #4

          extern <string literal> specifies the external linkage that its name is visible outside the file in which it is defined, Microsoft C++ supports the strings "C" and "C++" in the string-literal field to specify the linkage convention of other languages, you can link to the function, if the linkage conventions are same.

          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