File copying issue while converting to LPCTSTR

Posted by sijith on Stack Overflow See other posts from Stack Overflow or by sijith
Published on 2010-03-29T12:32:39Z Indexed on 2010/03/29 12:33 UTC
Read the original article Hit count: 427

Filed under:
|
|

// Convert to a wchar_t*

size_t origsize = strlen(toChar) + 1;

const size_t newsize = 100;

size_t convertedChars = 0;

wchar_t wcstring[newsize];

mbstowcs_s(&convertedChars, wcstring, origsize, toChar, _TRUNCATE);

wcscat_s(wcstring, L"\\*.*\0");

wcout << wcstring << endl; // C:\Documents and Settings\softnotions\Desktop\Release\*.*



SHFILEOPSTRUCT sf;

memset(&sf,0,sizeof(sf));

sf.hwnd = 0;

sf.wFunc = FO_COPY;

//sf.pFrom =wcstring;  /* when giving wcstring i am not getting answer */

 sf.pFrom = L"C:\\Documents and Settings\\softnotions\\Desktop\\Release\\*.*\0";

   wcout << sf.pFrom  <<endl;   // C:\Documents and Settings\softnotions\Desktop\Release\*.*

Both wcstring and sf.pFrom are same then y not gettng answer when assigning sf.pFrom =wcstring;

© Stack Overflow or respective owner

Related posts about MSDN

Related posts about vc++