×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

GetDllDirectory() isn't recognized!?!?

GetDllDirectory() isn't recognized!?!?

GetDllDirectory() isn't recognized!?!?

(OP)
I hate it when Visual Studio does this to me...
I'm trying to use GetDllDirectory() in my MFC DLL app.

I have this code in my function:

CODE

char dllDir[MAX_PATH];
DWORD ret = GetDllDirectoryA( (DWORD)MAX_PATH, (LPSTR)dllDir );
When I compile it, I get this compile error:

CODE

error C3861: 'GetDllDirectoryA': identifier not found, even with argument-dependent lookup
I added the SDK include and lib directories to my project settings.
I tried including <windows.h> and even <winbase.h> but no luck.

If I add this function declaration to my code (copied from <winbase.h>:

CODE

WINBASEAPI
DWORD
WINAPI
GetDllDirectoryA(
    IN DWORD nBufferLength,
    OUT LPSTR lpBuffer
    );
I get this link error:

CODE

error LNK2019: unresolved external symbol "__declspec(dllimport) unsigned long __stdcall GetDllDirectoryA(unsigned long,char *)"

If I try using the GetCurrentDirectory() function right above it in <winbase.h> it compiles and links with no problem.

Why does Visual Studio hate me?  sad

RE: GetDllDirectory() isn't recognized!?!?

(OP)
OK, nevermind.  I figured it out.
I guess it helps to read the entire page in MSDN instead of skimming through it.  winky smile
I needed to define some Windows preprocessor variables to a higher number:
http://msdn2.microsoft.com/en-us/library/aa383745.aspx

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close