I can't figure how why this is failing.



File1 db "C:\work\new.txt", 0
File2 db "C:\recycled\new.txt",0


main proc

LOCAL buffer[260]:BYTE
invoke GetCL,1,ADDR buffer
invoke MoveFile, offset File1, offset File2

Posted on 2004-11-30 21:41:13 by skywalker
Probably because you are not defining the strings in .data segment?
Regardless, check the result of the call (value in eax).
If it failed, the result is zero.
If you get return value of zero, immediately call GetLastError.
This will return a Windows error code that is usually pretty helpful.

Also, it's valid to use "addr" instead of "offset" when using the invoke calling method, eg "invoke MoveFile, addr szExisting, addr szNew"
Posted on 2004-11-30 22:02:51 by Homer