drama22
asked on
Copy file in dll not working but working on exe !
i am trying to compy files from location with dll here is my code
i got The operation completed successfully , but sadly no files has been copied why this working in exe application and not working in dll application ?
i try to copy file to CSIDL_COMMON_APPDATA path which is ProgramData folder
CopyFile(PChar(AppFolder +'\needed.dll'),Pchar(anotherfolder+'\needed.dll'), False);
memo1.Lines.Add(SysErrorMessage(GetLastError()))
i got The operation completed successfully , but sadly no files has been copied why this working in exe application and not working in dll application ?
i try to copy file to CSIDL_COMMON_APPDATA path which is ProgramData folder
Show us error message.
ASKER
No errors happend. It gives The operation completed successfully ... but not file copied
Try to search the file needed.dll on your disks. I think it was copied in another place.
You could try to output debug info of the AppFolder and anotherfolder from DLL and from EXE and compare them.
You could try to output debug info of the AppFolder and anotherfolder from DLL and from EXE and compare them.
ASKER
i searched no it does not copied to another place still exist only in the place that i want copy from .
i think i have problem with permission in ProgramData it should not be a problem because its working in exe bur in dll i dont know why its not working , i also unable to create folder inside that path from dll
i think i have problem with permission in ProgramData it should not be a problem because its working in exe bur in dll i dont know why its not working , i also unable to create folder inside that path from dll
Check your project settings.
I think you are have the different Character Set for the DLL and for the EXE projects.
One is Unicode, but another is not.
I think you are have the different Character Set for the DLL and for the EXE projects.
One is Unicode, but another is not.
ASKER
Thats really far away from the issue :) i dont know if you are familiar with delphi
ASKER
I've requested that this question be deleted for the following reason:
none of the answer help i already created new question about this
none of the answer help i already created new question about this
ASKER
I will try this sinisa and come back with result
ASKER
The problem is I cannot create subfolder inside common_appdata because dll dont have manifest like in exe I already create question about it here
https://www.experts-exchange.com/questions/28945262/creating-manifest-for-my-dll-that-called-from-activex.html
https://www.experts-exchange.com/questions/28945262/creating-manifest-for-my-dll-that-called-from-activex.html
Yes, it requires admin privilege... Have you try another folder (like CSIDL_LOCAL_APPDATA, inside custom folder)?
ASKER
Yes and its same it gives that file copied but it doesn't
ASKER
its obviously need manifest i tried to create one but i fail i made question about it
ASKER
sense we have another question to handle with the same issue i will close this one
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
None of answers will help others thats final result .