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. I feel pretty stupid...

I feel pretty stupid...

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorialquestion
4 Posts 3 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.
  • M Offline
    M Offline
    Marc Richarme
    wrote on last edited by
    #1

    ...but I'll have to ask anyway :) How to I import functions from a dll that don't have name decoration? If I do a __declspec(dllimport) void __stdcall MyFunc I get something like __imp__MyFunc@4, if I do a extern "C" void __stdcall MyFunc I get C name decoration: _MyFunc@4 and all this results in unresolved external symbols. The Win32 API does it by I can't get it to work... anyone plz?

    Cheers,
    Marc

    :beer: Click to see my *real* signature :beer:

    M J 2 Replies Last reply
    0
    • M Marc Richarme

      ...but I'll have to ask anyway :) How to I import functions from a dll that don't have name decoration? If I do a __declspec(dllimport) void __stdcall MyFunc I get something like __imp__MyFunc@4, if I do a extern "C" void __stdcall MyFunc I get C name decoration: _MyFunc@4 and all this results in unresolved external symbols. The Win32 API does it by I can't get it to work... anyone plz?

      Cheers,
      Marc

      :beer: Click to see my *real* signature :beer:

      M Offline
      M Offline
      Mike Nordell
      wrote on last edited by
      #2

      Look up stdcall (or maybe __stdcall). Basically it's PASCAL calling conventions that Win32 uses. Draw your own conclusions re. the history of Windows (though that its linker initially needed a switch to _obey_ case sensitivity rules might be a hint :-) ).

      1 Reply Last reply
      0
      • M Marc Richarme

        ...but I'll have to ask anyway :) How to I import functions from a dll that don't have name decoration? If I do a __declspec(dllimport) void __stdcall MyFunc I get something like __imp__MyFunc@4, if I do a extern "C" void __stdcall MyFunc I get C name decoration: _MyFunc@4 and all this results in unresolved external symbols. The Win32 API does it by I can't get it to work... anyone plz?

        Cheers,
        Marc

        :beer: Click to see my *real* signature :beer:

        J Offline
        J Offline
        James Pullicino
        wrote on last edited by
        #3

        Look up these WinAPI functions: LoadLibrary() GetProcaddress() James Drinking In The Sun Forgot Password?

        M 1 Reply Last reply
        0
        • J James Pullicino

          Look up these WinAPI functions: LoadLibrary() GetProcaddress() James Drinking In The Sun Forgot Password?

          M Offline
          M Offline
          Marc Richarme
          wrote on last edited by
          #4

          Originally, I intended to link to the DLL statically (at compile time), but it turned out to be slightly more tricky than I thought, so I had to fall back on a wrapper class that links to it at run-time, as you suggest it. :|

          Cheers,
          Marc

          :beer: Click to see my *real* signature :beer:

          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