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. Unable to use SetDllDirectory call in VS2005 - C++

Unable to use SetDllDirectory call in VS2005 - C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsonhelpquestion
4 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.
  • L Offline
    L Offline
    LindeA
    wrote on last edited by
    #1

    Hi, I try to use SetDllDirectory call, but fail to compile. Platform = WinXP SP2 ; VS2005 SP1 #define _WIN32_WINNT 0x0502 #include "windows.h" <...> SetDllDirectory(NULL); results in error C3861: 'SetDllDirectory': identifier not found When I literally copy the defs from winbase.h like this : #include "windows.h" // ( for SetDllDirectory call ) WINBASEAPI BOOL WINAPI SetDllDirectoryA( __in_opt LPCSTR lpPathName ); #define SetDllDirectory SetDllDirectoryA it compiles ok, but results in an unresolved external error LNK2019: unresolved external symbol "__declspec(dllimport) int __stdcall SetDllDirectoryA(char const *)" However, I do add kernel32.lib to the linker input. How should I use this api then ? Thanks in advance Linde

    C L 2 Replies Last reply
    0
    • L LindeA

      Hi, I try to use SetDllDirectory call, but fail to compile. Platform = WinXP SP2 ; VS2005 SP1 #define _WIN32_WINNT 0x0502 #include "windows.h" <...> SetDllDirectory(NULL); results in error C3861: 'SetDllDirectory': identifier not found When I literally copy the defs from winbase.h like this : #include "windows.h" // ( for SetDllDirectory call ) WINBASEAPI BOOL WINAPI SetDllDirectoryA( __in_opt LPCSTR lpPathName ); #define SetDllDirectory SetDllDirectoryA it compiles ok, but results in an unresolved external error LNK2019: unresolved external symbol "__declspec(dllimport) int __stdcall SetDllDirectoryA(char const *)" However, I do add kernel32.lib to the linker input. How should I use this api then ? Thanks in advance Linde

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

      Possibly you need an updated Platform SDK. :)

      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
      [My articles]

      L 1 Reply Last reply
      0
      • C CPallini

        Possibly you need an updated Platform SDK. :)

        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
        [My articles]

        L Offline
        L Offline
        LindeA
        wrote on last edited by
        #3

        No, I don't think so. The libs in the VC directory are more recent than the ones I find in the latest SDK update ( = from 2004 ! )

        1 Reply Last reply
        0
        • L LindeA

          Hi, I try to use SetDllDirectory call, but fail to compile. Platform = WinXP SP2 ; VS2005 SP1 #define _WIN32_WINNT 0x0502 #include "windows.h" <...> SetDllDirectory(NULL); results in error C3861: 'SetDllDirectory': identifier not found When I literally copy the defs from winbase.h like this : #include "windows.h" // ( for SetDllDirectory call ) WINBASEAPI BOOL WINAPI SetDllDirectoryA( __in_opt LPCSTR lpPathName ); #define SetDllDirectory SetDllDirectoryA it compiles ok, but results in an unresolved external error LNK2019: unresolved external symbol "__declspec(dllimport) int __stdcall SetDllDirectoryA(char const *)" However, I do add kernel32.lib to the linker input. How should I use this api then ? Thanks in advance Linde

          L Offline
          L Offline
          LindeA
          wrote on last edited by
          #4

          Resolved -------- I changed the order of the numerous #include lines : I put the #include "windows.h" as the first, and now it works.

          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