How to use DeleteFileA function

Back to topics list To post a new topic, please log in or register
avatar
2
ericoh88 2015.01.21 05:22
 

Hi 

I need help to figure out what is wrong with my codes like to delete a file and figure out the path.

#import "kernel32.dll"

   int CopyFileA(string lpExistingFileName,string lpNewFileName, bool bFailIfExists);

   int DeleteFileA(string lpFileName);

#import 

... 

...

   DeleteFileA(D:\\temp\\test.txt");

I have a file in D:\temp\test.txt but the program don't seem to work .

Where did I go wrong?

DeleteFileA(TerminalPath()+"\\MQL4\\files\\test.txt");

I have a file named test.txt in the working folder but same problem, the delete function not working. 

 

Thanks.  

 

 

avatar
2017
gooly 2015.01.21 10:25 #
 
You have to use Windows' ..W(..) like CopyFileW(), DeleteFileW(), ...
avatar
2
ericoh88 2015.01.21 17:57 #
 

Gooly 

I have got it working d. Thanks a million! 

Back to topics list  

To add comments, please log in or register