Libraries: File Mapping without DLL

 

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

 
HANDLE64 CMemMapFile::Open(LPTSTR path, DWORD size, int mode=modeOpen) 
{ 
m_size=size; m_path=path; m_mode=mode; m_pos=0; // начальное положение 
if (m_path=="") return(-1); 
m_hmem=Open(m_path, size, mode, err); 
if (m_hmem==NULL) return(err); // если ошибка создания 
return(0); 
} 

Hi, in the code above "return(0)" should be corrected into "return(m_hmem)", otherwise it wont return the handle of memory mapped file.

 
thank you, good work.