A Journey 2 Eternity

Retrieve the Application Directory

Posted on: September 22, 2008

// With standard string
char szAppPath[MAX_PATH] = “”;
char szAppDirectory[MAX_PATH] = “”;

::GetModuleFileName(0, szAppPath, sizeof(szAppPath) – 1);

// Extract directory
strncpy(szAppDirectory, szAppPath, strrchr(szAppPath, ‘\\’) – szAppPath);
szAppDirectory[strlen(szAppDirectory)] = ”;
Advertisements

1 Response to "Retrieve the Application Directory"

Thank you! very useful. Keep it with good work. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Pages

Categories

September 2008
M T W T F S S
« Aug   Dec »
1234567
891011121314
15161718192021
22232425262728
2930  

Blog Stats

  • 27,176 hits
%d bloggers like this: