Here is the code . Everything works fine as long as I use
the char *, but if I use CStrings instead ,in passing the
file names it throws an error. I tried to assign the
allocated CStrings to char pointers but wouldn’t work. It’s
bizarre. Any clues how to convert the CSring to char * and
still make it work.

Thanks,


bool bFailIfExists = false;

char *strTS = "c:\\temp\\msv.txt";
char *strTD = "\\\\MyMachine\\ docs\\msv.txt";

CString strSource("c:\\temp\\msv.txt"), strDest
("\\\\MyMachine\\docs\\msv.txt");

SHFILEOPSTRUCT shop;
ZeroMemory(&shop, sizeof(shop));
shop.hwnd = AfxGetMainWnd()->m_hWnd;
shop.wFunc = FO_COPY;
shop.pFrom = strTS;
shop.pTo = strTD;
shop.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;


if (0 == SHFileOperation(&shop))
{
bool bRet = true;
}