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]
			
			
									
									
						API Copy problem
- 
				Bonne_den_kule
 - Addict

 - Posts: 841
 - Joined: Mon Jun 07, 2004 7:10 pm
 
Code: Select all
Error.l = SHFileOperation_(@Switches)code change
call line should read like this.
			
			
									
									
						Code: Select all
 result.l = C_To_Dir("C:\test4\test.exe","C:\test\testagain.exe")
