How getting application path from VC6

Which is the Visual C++6 NON MFC equivalent of Visual Basic App.path property to get application path?
Best regards,
Chris
cbonjoviAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jkrConnect With a Mentor Commented:
Well, in this case, you'll have to make it relative to your project dir, e.g.

#import "..\..\..\Server\AMDLL_DB\Amdb.dll"  no_namespace

You'll have to adapt it to your situation, of course.
0
 
jkrCommented:
char acPath [ MAX_PATH];

GetModuleFileName ( NULL, acPath, MAX_PATH);
0
 
cbonjoviAuthor Commented:
Oh thank you jkr, but I have a problem.
I have this #import definition:

#import "d:\Server\AMDLL_DB\Amdb.dll"  no_namespace

before all the code.
I would like to make this path relative to application path and not absolute.
What have I do?
Best regards,
Chris
0
 
cbonjoviAuthor Commented:
OK, jkr. Perfect.
Don't know why this solution wasn't working when I had tried it.
Now it's all OK.
Fixed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.