Download MetaTrader 5
To add comments, please log in or register
Add our Twitter channel to friends and follow the news!
Eric
7
Eric 2015.01.21 04: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.  

Carl Schreiber
5960
Carl Schreiber 2015.01.21 09:25  
You have to use Windows' ..W(..) like CopyFileW(), DeleteFileW(), ...
Eric
7
Eric 2015.01.21 16:57  

Gooly 

I have got it working d. Thanks a million! 

/
To add comments, please log in or register