Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written code using the Microsoft detours library, but it does not work on windows 7 os.

In my program, I detours functions below:

CopyFile,CopyFileEx,MoveFile,MoveFileEx,DeleteFile,CreateDirectory,CreateDirectoryEx,SHFileOperation

On my windows xp, all the detours functions work fine, but on windows 7 only the 'MoveFileEx' works fine, others not.

Why ?
Help, please.
Posted
Updated 15-Dec-10 22:32pm
v2
Comments
Richard MacCutchan 12-Dec-10 3:51am    
You need to look at your code and check the results of the function calls to see why they are failing. It could be any number of problems but it's impossible to guess.
Dalek Dave 16-Dec-10 4:33am    
Edited for Spelling, Grammar, Syntax and Readability.

It's impossible to know without using GetLastError[^] to find out what went wrong, but a likely cause would be a UAC problem.

Running the program with administrator rights could solve things in this case.
 
Share this answer
 
Comments
EverettJF 12-Dec-10 4:56am    
I have considered the UAC problem,so I have already closed the UAC.
If it is the UAC problem ,the MoveFileEx should not work fine.
The problem is not these functions but access rights issue in Windows 7. Do one thing try to execute application run as admin. Try to compile your application with requireAdministrator.
 
Share this answer
 
may be it is the IFileOperation problem
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900