visual c++ - what is the problem with my path inside CString? -



visual c++ - what is the problem with my path inside CString? -

why code not work? :(

cstring parametera = _t("c:\program files\test\identify.exe"); cstring parameterb = _t(" -format \"%w\" ") + picturename; if (createprocess(parametera.getbuffer(), parameterb.getbuffer(),0,0,true, normal_priority_class|create_no_window,0,0,&sinfo,&pinfo)) { waitforsingleobject (pinfo.hprocess, infinite); }

but, when alter the....

cstring parametera = _t("c:\program files\test\identify.exe");

to..

cstring parametera = _t("identify.exe");

it works.

help me..

it's slashes.

cstring parametera = _t("c:\program files\test\identify.exe");

note have escape sequences \p, \t , \i, 1 of means (\t tab character, , not want!).

instead, escape slashes interpreted slashes:

cstring parametera = _t("c:\\program files\\test\\identify.exe");

visual-c++

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -