mfc >> Application Path API

by mandar2019 » Sun, 26 Mar 2006 13:08:26 GMT

Dear Friends..
I want to make a setup for my VC++ application. But in the coding of
the application I ve given a hard coded path for my accessory files..
like "C:\\temp\\"..etc. but after installing the setup on others m/c,
this hard coded path is not going to work.
I do not know "HOW TO SET THE APPLICATION PATH FOR FILES" during VC++
coding in program.. I do not know the API for the same.
Can anyone HELP me on this issue.. I need how to write acodes for
Application Path..

Thanx & Regards
Mandar



mfc >> Application Path API

by Ajay Kalra » Sun, 26 Mar 2006 13:18:21 GMT


GetModuleFileNameEx will give you the path of application executable.
This is fixed. You can also use a directory for your application using
GetCurrentDirectory/SetCurrentDirectory.

----
Ajay Kalra
XXXX@XXXXX.COM




Similar Threads

1. application path - CSharp/C#

2. find the startup path of a console application

3. How to get the application path :S - CSharp/C#

4. A question about using relative paths in my windows application

Hi everyone,

This is probably a pretty stupid question but does anyone know if its
possible to use relative addressing when it comes to accessing an image of
the file system?

In particular, I am making a simple application that needs to load a
treeview with icons. The icons are stored in a folder called icons under the
application's directory. (The folder exists in the same dir as the bin
folder and the debug folder)

The only way I can get the image to work is to put in the whole address.

Is it possible to use a relative address? Like just \icons or something? Is
it a good idea to do this?

I'm just trying to think ahead to what it would take to deploy this
application. (Not that I'm going to). I would need some sort of generic
address mechanism and of course Absolute Addressing is not at all generic.

Any advice would be greatfully recevied.

Simon


5. retrieve console application path - CSharp/C#

6. How to get Application Path?

Hi,

Use Application.StartupPath

Nirosh.

"Frank Rizzo" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> How to get Application Path?
>
> I can't really use
> System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
>
> because it returns the path in the file://c/winnt/.../filename.exe
> format, which I can't really use to open files, etc...
>
> I also don't want to use System.Windows.Forms.Application.ExecutablePath
> because I don't want to include Windows Forms for my console app.
>
> Thanks
>


7. .exe path for non-GUI application - CSharp/C#

8. C# and returning relative application path

 The two lines here are returning exactly what I'm looking for;
Problem is they only work in the .aspx page's "code behind" for that
page.

string path1 = Page.MapPath("~/");
string path2 = Server.MapPath("~/");

How do I get this info from a .cs custom class in the \app_code
folder? (e.g. just a stand alone class with no associated page?)  I am
not having any luck finding answer. Thanks,

Yin