You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I wonder if it is possible to get a real pointer to a function. Pointers obtained using typedef work perfectly well inside mql program. But unfortunately I failed to pass them into dll.
If you know C++ + built-in assembler and know what and how to put into the stack, and the terms far and near call are clear, you can try. I cannot guarantee that it will work, but it is possible.
Where's the mistake?
Your example in the code is quite different. I am trying to get the value from the address.
There is an example in the article.
Your example in the code is quite different. I am trying to get the value from the address.
There is an example in the article.
I have highlighted the places where it is written by address. However, this example from the article also causes a crash.I immediately understood what you wanted. I am sure that the address returned from WinAPI functions cannot be used in MQL5. But the address is passed to the arguments correctly.
You can be absolutely sure by writing a simple DLL that shows the address received in the argument and returns it. And compare the result in MQL5. Many people here practice C.
Where's the mistake?
Corrected yours:
You should have a Lenght of 4 or less everywhere
Copying more than 2GB works
Getting the starting address of the array:
Your example in the code is quite different. I am trying to get the value from the address.
There is an example in the article.
I have highlighted the places where it is written by address. However, this example from the article also causes a crash.Of course it does... the prototypes are from 4 (32-bit address a la unsigned int), and you compile/run them in 5 (it has 64).
You can't trust anyone, if you use WinAPI - write prototypes yourself. Or better to write your own DLL, let it pull winapi, and upstairs in mql gives interfaces of higher level
Copying more than 2GB works
Getting the initial address of the array:
I missed the point with the 64bit address. But I still crash with the corrected address. Is it sure it should work? Can I see a full example of the corrected fxsaber code?
So far I am still of my own opinion - the address from WinAPI is incompatible with MQL.
Fixed yours:
of course it does...prototypes are from 4 (32 bit address a la unsigned int) and compile/run in 5 (it has 64).
Thanks, it works now.
The last parameter (which is cnt) is also 64 bits. It is size_t
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/memcpy-wmemcpy