API Copy problem

Just starting out? Need help? Post your questions and find answers here.
trather
User
User
Posts: 29
Joined: Sun Nov 07, 2004 9:57 pm

API Copy problem

Post by trather »

I don't understand what is happening. Have have this API code that I have used in the past. Now when I use PB 4.02 and try to use it sometimes it works other times it comes back and says that it can't find the file name. I have no idea what is wrong. Can someone take a look at the code and see if they see anything wrong with it. I can get it to work fine when it is all by itself but when I put other procedure with it and then call those procedure before it something happens and then it keeps telling me that it can't read the file on the disk.

[code]
Procedure.l C_To_Dir(FromLoc.s, Toloc.s)

Switches.SHFILEOPSTRUCT ;Windows API Structure
File_From.s = FromLoc
File_Dest.s = Toloc

FromDirectory.s = File_From
ToDirectory.s = File_Dest

Switches\wFunc = #FO_COPY

Switches\pFrom = @FromDirectory
Switches\pTo = @ToDirectory

Switches\fFlags = #FOF_NOCONFIRMATION | #FOF_NOCONFIRMMKDIR

Error.l = SHFileOperation_(Switches)
ProcedureReturn Error
EndProcedure

Error.l = C_To_Dir("C:\test4\test.exe","C:\test\testagain.exe")
[/code]
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

Code: Select all

Error.l = SHFileOperation_(@Switches)
trather
User
User
Posts: 29
Joined: Sun Nov 07, 2004 9:57 pm

code change

Post by trather »

call line should read like this.

Code: Select all

 result.l = C_To_Dir("C:\test4\test.exe","C:\test\testagain.exe")
Post Reply