Solved

How getting application path from VC6

Posted on 2001-08-13
4
260 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
Comment Utility
char acPath [ MAX_PATH];

GetModuleFileName ( NULL, acPath, MAX_PATH);
0
 

Author Comment

by:cbonjovi
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

16 Experts available now in Live!

Get 1:1 Help Now