Hi All,
I have a C++ program( using VC++6.0 with MFC) which calls another C++ .exe and performs some actions on it. The problem I am facing is that I get the file name of the .exe by using a GetDirectory function. Thus I am able to get the full file name such as "C:\projectname\software\debug\something.exe". Next I am trying to use the ShellExecute function to use this file name in the parameters such as ShellExecute(NULL,"open" ,"PatternName", NULL, NULL, SW_SHOWNORMAL); where PatternName is "C:....." . This doesn't give any errors but just that the .exe doesn't open! I realised that if I use double slash in the file name it works fine. But since I get the file in the above format(with single slash) I am unable to do that. Is there any workaround?As far as the filename is concerned I am only able to break it into drive,dir,filename(debug), ext using splitpath.
I cannot give the file name directly because diff user save the file in diff locations and we need to change the path in each of their pgms which is not viable option.
Any help is appreciated..
Thanks in advance
krisny 0 Newbie Poster
Frederick2 189 Posting Whiz
krisny 0 Newbie Poster
JasonHippy 739 Practically a Master Poster
opcode 15 Newbie Poster
krisny 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.