Leo tengo un pequeño problemilla ya que ahora que he creado la carpeta quiero copiar un fichero a esa carpeta pero no hay manera.SHGetSpecialFolderLocation(Handle, CSIDL_DESKTOPDIRECTORY, &ItemID);
if(ItemID != NOERROR)
{
char szDirPath[MAX_PATH];
SHGetPathFromIDList(ItemID, szDirPath);
sDesktopPath = szDirPath;
if (sDesktopPath[sDesktopPath.Length()] != '\\') sDesktopPath += "\\";
}
else throw Exception("ERROR :: SHGetSpecialFolderLocation");
bRet = DirectoryExists(sDesktopPath + Leccion);
sDesktopFinal = sDesktopPath + Leccion;
if (bRet) // Si existe el directorio solo copia el fichero ShowMessage("Existe");
CopyFile(FinalPath.c_str(),sDesktopFinal.c_str(),false);
else { // Si no existe el directorio crea el fichero y copialo
bRet = CreateDir(sDesktopPath + Leccion);
CopyFile(FinalPath.c_str(),sDesktopFinal.c_str(),false);
if (bRet) {} //ShowMessage("Se creo la carpeta");
else ShowMessage("NO se pudo crear la carpeta");
}
La función CopyFile me devuelve 0, por lo que se ha producido un error y no lo copia.
El fichero por supuesto existe y no comprendo porque no lo copia.
¿Alguna idea?