Solved

How getting application path from VC6

Posted on 2001-08-13
4
264 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 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