Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How getting application path from VC6

Posted on 2001-08-13
4
Medium Priority
?
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 120 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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 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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

636 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