Click here to Skip to main content
15,910,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to insert a back slash \ in a string Pin
Cedric Moonen11-Aug-05 21:53
Cedric Moonen11-Aug-05 21:53 
GeneralRe: how to insert a back slash \ in a string Pin
caykahve11-Aug-05 22:11
caykahve11-Aug-05 22:11 
GeneralRe: how to insert a back slash \ in a string Pin
Cedric Moonen11-Aug-05 22:16
Cedric Moonen11-Aug-05 22:16 
GeneralRe: how to insert a back slash \ in a string Pin
caykahve11-Aug-05 22:43
caykahve11-Aug-05 22:43 
GeneralRe: how to insert a back slash \ in a string Pin
Cedric Moonen11-Aug-05 22:52
Cedric Moonen11-Aug-05 22:52 
GeneralRe: how to insert a back slash \ in a string Pin
caykahve11-Aug-05 23:24
caykahve11-Aug-05 23:24 
AnswerRe: how to insert a back slash \ in a string Pin
David Crow12-Aug-05 3:22
David Crow12-Aug-05 3:22 
GeneralRe: how to insert a back slash \ in a string Pin
caykahve12-Aug-05 5:47
caykahve12-Aug-05 5:47 
C:\folder is actually is not a user input, it is

// Get Program Files Path <br />
SHGetSpecialFolderPath(NULL,PFPath.GetBuffer(_MAX_PATH), CSIDL_PROGRAM_FILES, FALSE);<br />

and it gets "C:\Program Files" exactly.

I add something at the end of this string and then i try to use it in

<br />
CString WholePath = PFPath + (CString)"\\....\\file.exe;<br />
SHELLEXECUTEINFO shellInfo;<br />
...<br />
shellInfo.lpFile = WholePath;<br />
::ShellExecuteEx(&shellInfo);


If I do not use double slash, I get the error: "The program cannot find the file specified"
That's why I need double slash.

Why is it so hard to insert the required character in to a string I don't understand. Sigh | :sigh:

Is there some other way to obtain "C:\\Program Files"?
GeneralRe: how to insert a back slash \ in a string Pin
David Crow12-Aug-05 6:06
David Crow12-Aug-05 6:06 
Generalsocket communication with video Pin
Nishad S11-Aug-05 21:41
Nishad S11-Aug-05 21:41 
GeneralRe: socket communication with video Pin
ThatsAlok11-Aug-05 22:24
ThatsAlok11-Aug-05 22:24 
GeneralSorting List View Pin
BicycleTheif11-Aug-05 20:45
BicycleTheif11-Aug-05 20:45 
GeneralRe: Sorting List View Pin
Jose Lamas Rios11-Aug-05 20:50
Jose Lamas Rios11-Aug-05 20:50 
GeneralRe: Sorting List View Pin
SVPG12-Aug-05 0:55
SVPG12-Aug-05 0:55 
GeneralRe: Sorting List View Pin
David Crow12-Aug-05 3:27
David Crow12-Aug-05 3:27 
GeneralMS Word automation Pin
Imtiaz Murtaza11-Aug-05 18:05
Imtiaz Murtaza11-Aug-05 18:05 
GeneralRe: MS Word automation Pin
Jose Lamas Rios11-Aug-05 18:35
Jose Lamas Rios11-Aug-05 18:35 
Generalhelp needed VC++ with MS Word Pin
Barm11-Aug-05 15:48
Barm11-Aug-05 15:48 
GeneralRe: help needed VC++ with MS Word Pin
Jose Lamas Rios11-Aug-05 16:21
Jose Lamas Rios11-Aug-05 16:21 
GeneralRe: help needed VC++ with MS Word Pin
Barm11-Aug-05 16:38
Barm11-Aug-05 16:38 
GeneralMore help needed VC++ with MS Word Pin
Barm11-Aug-05 17:41
Barm11-Aug-05 17:41 
GeneralExit codes Pin
#realJSOP11-Aug-05 15:45
professional#realJSOP11-Aug-05 15:45 
GeneralRe: Exit codes Pin
Christian Graus11-Aug-05 15:52
protectorChristian Graus11-Aug-05 15:52 
GeneralRe: Exit codes Pin
Jose Lamas Rios11-Aug-05 16:33
Jose Lamas Rios11-Aug-05 16:33 
GeneralRe: Exit codes Pin
#realJSOP11-Aug-05 23:14
professional#realJSOP11-Aug-05 23:14 

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.