Bonjour,
Voila j'ai un petit soucis quand j'utilise SHFILEOPSTRUCT pour copier des fichiers.
Quand je fais le code suivant, je n'ai aucun problème, cela marche parfaitement.
SHFILEOPSTRUCT fileop;
fileop.hwnd = NULL;
fileop.wFunc = FO_COPY;
fileop.pFrom = "C\\temp\\monOCX.ocx";
fileop.pTo = "C:\\temp1\\";
fileop.fFlags = FOF_ALLOWUNDO|FOF_NOCONFIRMATION|FOF_NOCONFIRMMKDIR;
SHFileOperation(&fileop);
Mais quand je fais le code suivant, cela ne marche plus.
CString test = "C:\\temp\\monOCX.ocx";
fileop.pFrom = test ;
fileop.pTo = "c:\\temp1\\";
fileop.fFlags = FOF_ALLOWUNDO|FOF_NOCONFIRMATION|FOF_NOCONFIRMMKDIR;
SHFileOperation(&fileop);
Quelqu'un saurait pourquoi ?? comme message d'erreur, il me dit "impossible de copier: impossible de lire le fichier source". Pourtant le fileop.pFrom prend un LPCTSTR.
http://msdn.microsoft.com/en-us/library/bb759795(VS.85).aspx
Merci à tous pour vos réponses