Solved

How getting application path from VC6

Posted on 2001-08-13
4
263 Views
Last Modified: 2013-12-03
Which is the Visual C++6 NON MFC equivalent of Visual Basic App.path property to get application path?
Best regards,
Chris
0
Comment
Question by:cbonjovi
  • 2
  • 2
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6381108
char acPath [ MAX_PATH];

GetModuleFileName ( NULL, acPath, MAX_PATH);
0
 

Author Comment

by:cbonjovi
ID: 6381459
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
 
LVL 86

Accepted Solution

by:
jkr earned 30 total points
ID: 6381480
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
 

Author Comment

by:cbonjovi
ID: 6381646
OK, jkr. Perfect.
Don't know why this solution wasn't working when I had tried it.
Now it's all OK.
Fixed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now