Is there a chance the .wav file is opened in another application (like does
write over existing files.
My code is posted below, BUT it seems that the issue is with the file
extension because the code will quite happily work with text files in the
same folder, but will not move (or incidentally copy) the files. When I
try I am getting the
following error message
failed with error 123: The filename, directory name, or volume label
syntax is incorrect."
I can manually copy / cut and paste the .wav files
My code snippet -
CString csFile1 = "c:\\location a\\subdir\\subsubdir\\file.wav";
CString csFile2 = "c:\\location b\\subdir\\subsubdir\\file.wav";
if(MoveFileEx(csFile1, csFile2, MOVEFILE_COPY_ALLOWED))
{
WriteStringToFile(csFile2 ); //my own function which never gets
called
}
else
{
TCHAR szBuf[80];
LPVOID lpMsgBuf;
DWORD dw = GetLastError();
LPTSTR lpszFunction = "";
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
wsprintf(szBuf,
"%s failed with error %d: %s",
lpszFunction, dw, lpMsgBuf);
WriteStringToFile(szBuf);
LocalFree(lpMsgBuf);
}
"David Wilkinson" <no-reply@effisols.com> wrote in message
news:upVNtc41IHA.4912@TK2MSFTNGP03.phx.gbl...
Tony wrote:
Hi,
I am moving a file from c:\location a\subdir\subsubdir\file.wav to
c:\location b\subdir\subsubdir\file.wav
but the error message i get is
"failed with error 123: The filename, directory name, or volume label
syntax is incorrect."
I am running on a vista home premium machine, using visual studio 6 if
that helps.
Tony:
Shouldn't you be showing us some code?
--
David Wilkinson
Visual C++ MVP