CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Unable to use SetDllDirectory call in VS2005

    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"
    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

  2. #2
    Join Date
    Nov 2008
    Posts
    3

    Re: Unable to use SetDllDirectory call in VS2005

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured