i can only think of two things
one is that import dll is disabled and 2 the file path is incorrect/does not exist at the specified location.
i would first try to reach a file in the local directory then crawl my way out to where i need to be sometimes specifying the correct paths can be advantageous.
i can only think of two things
one is that import dll is disabled and 2 the file path is incorrect/does not exist at the specified location.
i would first try to reach a file in the local directory then crawl my way out to where i need to be sometimes specifying the correct paths can be advantageous.
- the option: "Options / Expert Advisors / Allow DLL imports" is checked
- the path is correct
¿could you check by your self that script with DLL allowed and a valid TXT file with content: "Hello world!"?
Thank you Marco!
so i get the same outcome but i did notice there were issues with access rights to the file so make sure u run as administrator.
I accessed as administrator (runned MT5 as admin) :(
but if you get the same output as administrator then that's not te problem.
The "_lopen" function works correctly because I get a handle. Also "_llseek" rise no error,
but the problem is the function: "_lread".
http://winapi.freetechsecrets.com/win32/WIN32lread.htm
The _lread function reads data from the specified file. This function is provided for
compatibility with 16-bit versions of Windows.
Win32-based applications should
use the ReadFile function.
http://winapi.freetechsecrets.com/win32/WIN32ReadFile.htm
BOOL ReadFile(
|
---|

- winapi.freetechsecrets.com
http://winapi.freetechsecrets.com/win32/WIN32lread.htm
The _lread function reads data from the specified file. This function is provided for
compatibility with 16-bit versions of Windows.
Win32-based applications should
use the ReadFile function.
http://winapi.freetechsecrets.com/win32/WIN32ReadFile.htm
BOOL ReadFile(
|
---|
Thank you Marco!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello folks, I have spent all the afternoon trying to get the following code works.
After tried it with no success, I built a completely different code with Windows APIs to use the correct names from Kernel32 library but also didn't work.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365467%28v=vs.85%29.aspx
Then, I write this post with the initial code I got from:
https://www.mql5.com/en/articles/1540
I need this custom function to read the entire content of a TXT file on whatever location on the file system.
With the following erroneous script I get:
when I should get:
The script code is ready to copy/paste/run:Thank you!