Alex, did you envisage passing a virtual file handle to another thread?
I haven't found it, if there is, please point me to it.
ZY But in general, this is a good thing.
Alex, have you ever considered passing the handle of a virtual file to another thread?
What's the problem?
No problem, I encapsulated the handle and passed it to another object, everything works.
I'm just looking for where you provided for such a file access transfer.
in CMemMapApi class the memory handle should be stored by the programme that uses it (this object).
and in CMemMapFile - the handle is stored in public m_hmem
in CMemMapApi class the memory handle should be stored by the programme that uses it (this object).
and in CMemMapFile - the handle is stored in public m_hmem.
Then I don't understand something very well :)
specify after closing the file it can be opened in another programme or
is it destroyed after closing?
and when the file is destroyed and memory is freed?
Aha figured it out, you can not pass handles, but just make a new opening in a new thread by file name.
Well Nikolay, why did I do all this? :) of course, so that different software can simultaneously write/read to one common file.
Alex, thank you for your labours. I haven't tried to use it yet, as it's still a new topic for me, I need to read (Rashid suggested articles). But here is a question for the moment. In the topic title it is emphasised - without DLL. But there is an appeal to kernel32.dll and to msvcrt.dll. So this solution is not suitable for the Market?
It is not suitable for the Market (although it is still under question), but Renat said that he would think about implementing such things in the MQL5 standard.
In the title I meant without self-written dlls, after all, the standard Windows dlls are safer than self-written ones.
The title meant without self-written dlls, after all, the standard Windows dlls are safer than self-written ones.
Yes, I meant without self-written dlls. And standard ones are safe in the sense that everyone knows what they do.
for the market this solution (according to the existing rules) is not suitable.
but the market (I really hope) will accept my proposed variant as a basic one - you can publish an Expert Advisor that calls functions from ex5-library.
That is, all dll calls are placed in ex5, which is not exposed in the market, but lies either in the codebase or at the developer's site.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
File Mapping without DLL:
The classes (conveted from C++ to MQL5) for working with memory mapped files.
The C++ project was published in CodeBase: Memory Mapping.
The example script is included.
Author: Alex Sergeev