Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to find the path of my current running application Pin
Hamid_RT26-Oct-07 1:24
Hamid_RT26-Oct-07 1:24 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:44
chandu00426-Oct-07 1:44 
GeneralRe: How to find the path of my current running application Pin
Hamid_RT26-Oct-07 1:53
Hamid_RT26-Oct-07 1:53 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:59
chandu00426-Oct-07 1:59 
GeneralRe: How to find the path of my current running application Pin
Roger Stoltz26-Oct-07 1:33
Roger Stoltz26-Oct-07 1:33 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 3:01
chandu00426-Oct-07 3:01 
AnswerRe: How to find the path of my current running application Pin
Jonathan [Darka]26-Oct-07 0:56
professionalJonathan [Darka]26-Oct-07 0:56 
AnswerRe: How to find the path of my current running application [modified] Pin
Nelek28-Oct-07 23:15
protectorNelek28-Oct-07 23:15 
Try with...
CString m_szNewFileName = "";
char FileName[MAX_PATH];
GetModuleFileName(NULL, FileName, MAX_PATH);
m_szNewFileName = FileName;
m_szNewFileName = m_szNewFileName.Left(m_szNewFileName.ReverseFind('\\'));
m_szNewFileName += "DesiredNewName.ext"

CFile f (m_szNewFileName, CFile::modeCreate | CFile::modeWrite);


it worked good for me.

This would create the new file in the forlder where the App.exe is.


And afterwards you can delete the file with:

if (f.Open (m_szNewFileName, CFile::modeRead))
{	f.Close ();
	f.Remove (m_szNewFileName);
}



EDIT: Nice, my post is the newest one, but has the answers of the post just above (older than mine)D'Oh! | :doh: :P


-- modified at 5:21 Monday 29th October, 2007


-- modified at 5:22 Monday 29th October, 2007

Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

Help me to understand what I'm saying, and I'll explain it better to you

Wink | ;)

GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:06
chandu00426-Oct-07 1:06 
GeneralRe: How to find the path of my current running application Pin
Jonathan [Darka]26-Oct-07 1:19
professionalJonathan [Darka]26-Oct-07 1:19 
GeneralRe: How to find the path of my current running application Pin
chandu00426-Oct-07 1:56
chandu00426-Oct-07 1:56 
GeneralRe: How to find the path of my current running application Pin
ThatsAlok28-Oct-07 22:12
ThatsAlok28-Oct-07 22:12 
QuestionSPY++ Pin
Imtiaz Murtaza26-Oct-07 0:25
Imtiaz Murtaza26-Oct-07 0:25 
AnswerRe: SPY++ Pin
Karismatic26-Oct-07 0:30
Karismatic26-Oct-07 0:30 
QuestionCListCtrl problem, let it show color 1 in odd row and color 2 in even row Pin
fantasy121525-Oct-07 23:54
fantasy121525-Oct-07 23:54 
AnswerRe: CListCtrl problem, let it show color 1 in odd row and color 2 in even row Pin
_AnsHUMAN_ 26-Oct-07 1:12
_AnsHUMAN_ 26-Oct-07 1:12 
QuestionBeep Pin
mcsherry25-Oct-07 23:46
mcsherry25-Oct-07 23:46 
AnswerRe: Beep Pin
_AnsHUMAN_ 26-Oct-07 1:30
_AnsHUMAN_ 26-Oct-07 1:30 
Questionhow to monitor exe and dll interactions? Pin
George_George25-Oct-07 23:09
George_George25-Oct-07 23:09 
AnswerRe: how to monitor exe and dll interactions? Pin
Jonathan [Darka]26-Oct-07 0:59
professionalJonathan [Darka]26-Oct-07 0:59 
GeneralRe: how to monitor exe and dll interactions? Pin
George_George26-Oct-07 6:44
George_George26-Oct-07 6:44 
GeneralRe: how to monitor exe and dll interactions? Pin
Jonathan [Darka]26-Oct-07 13:03
professionalJonathan [Darka]26-Oct-07 13:03 
GeneralRe: how to monitor exe and dll interactions? Pin
George_George26-Oct-07 21:20
George_George26-Oct-07 21:20 
QuestionGetting active and past local users of system Pin
Subhash Karemore25-Oct-07 22:56
Subhash Karemore25-Oct-07 22:56 
QuestionRe: Getting active and past local users of system Pin
David Crow26-Oct-07 2:58
David Crow26-Oct-07 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.