Click here to Skip to main content
15,917,565 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: how to insert a back slash \ in a string Pin
David Crow12-Aug-05 6:06
David Crow12-Aug-05 6:06 
You are still have a bit confused. There is no need to change PFPath, and the string literal being appended to it is fine (because it contains the necessary double backslashes). You don't need to insert anything additional. The variable WholePath contains what it needs to.

caykahve wrote:
If I do not use double slash, I get the error: "The program cannot find the file specified"

Rightly so. But the code snippet you've shown does have a double backslash so I don't see the problem.

caykahve wrote:
Is there some other way to obtain "C:\\Program Files"?

Why, when you are already doing it correctly?

If you tried to access a file using code like:

"c:\program files\some_folder\mydata\file.dat"
not only would the compiler complain about illegal escape characters (e.g., \p and \s and \m make no sense, but \f does), it would have interpreted that as

"c:rogram filesome_folderydata\file.dat"
hence the file not being found.


"One must learn from the bite of the fire to leave it alone." - Native American Proverb


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 
GeneralRe: Exit codes Pin
David Crow12-Aug-05 3:35
David Crow12-Aug-05 3:35 

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.