Exchanging data between two EAs running in different terminals - page 8

 
zhuki >>:

В личке

Thank you.

 
This is not the source code, nor is it a DLL. This is a framed DLL source header that took over a week to write. It took a week to write the class for the mapping. Mostly to think about the structuring.
And it took 60 minutes to write 60 functions. There are a couple of lines in each function.

//| GENERAL FUNCTIONS.

//| 1. The function creates or opens a file mapping by user file descriptor and/or name of file mapping with the possibility of |
//| preliminary change of size of the memory allocated for it. If no file mapping exists, one is created.
The //| function returns a file mapping system descriptor if successful, otherwise NULL.
//| HANDLE FileMappingCreate(const int hFileUser, // //user file system descriptor.
//| const char *szNameFileMapping, //Name for projected file.
//| const const int nBytes); // Amount of memory to be reserved for file mapping.

//| 2. The function opens the file mapping. The function returns a file mapping system descriptor if successful, otherwise NULL.
//| HANDLE FileMappingOpen(const char *szNameFileMapping); //Name for the file to be projected.

//| 3. The function clears the file mapping by its name.
//| Function returns: 1 successful completion;
//| 0 other errors; |
//| -1 initial address not received;
//| -2 memory not cleared;
//| -3 file mapping failure.
//| int FileMappingClear(const char *szNameFileMapping); // name of file mapping.

//| 4. The function closes the file mapping by its name. The function returns TRUE if it succeeds, otherwise FALSE.
//| bool FileMappingClose(const char *szNameFileMapping); //Name of the file mapping.

A //| GENERIC FUNCTION FOR ACCESSING THE FILE MAPPING REPRESENTATION OF THE PROJECTED FILE IN THE ADDRESS SPACE OF THE CALLING PROCESS.

//| 5. The function creates a file mapping by the user's file descriptor and/or file mapping name with the ability to change the
//| size of the memory allocated for it in advance and mapping the projected file representation into the address space of the calling process.
The //| function returns a pointer to the first byte of the mapping memory area if successful, otherwise NULL.
//| char *FileMappingCreateViewOfFile(const int hFileUser, // //The system descriptor of the user file.
//| const char *szNameFileMapping, //Name for projected file.
//| const const int nBytes); // Amount of memory to be reserved for file mapping.

//| 6. The function opens the file mapping by its name and maps the representation of the projected file into the address space of the calling process.
//| The function returns a pointer to the first byte of the mapping memory area of the projected file representation if successful, otherwise NULL.
//| char *FileMappingOpenViewOfFile(const char *szNameFileMapping); // Name for the projected file.

//| 7. The function maps the representation of the projected file into the address space of the calling process.
The //| function returns TRUE on success or FALSE on error.
//| bool FileMappingViewOfFile(const char *pcAddress); // Pointer to the first byte of the memory area of the projected file representation returned by
//| // functions FileMappingCreateViewOfFile(), FileMappingOpenViewOfFile().

//| 8. The function cancels the presentation of the projected file into the address space of the calling process.
//| The function returns TRUE on success or FALSE on error.
//| bool FileMappingUnViewOfFile(const char *pcAddress); // Pointer to the first byte of the memory area of the projected file representation,
//| // returned by FileMappingCreateViewOfFile(), FileMappingOpenViewOfFile().

//| FUNCTIONS TO WRITE NUMBERS AND STRINGS TO THE FILE MAPPING.

//| 9. The function opens a file mapping and writes a logical BOOL value to it from the specified byte in memory.
//| If no file mapping exists, it is created. The function converts a number of INT type to BOOL to write to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 initial address not received;
//| -3 value not written to memory;
//| -4 file mapping failure.
//| int FileMappingWriteBoolValue(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the number will be written.
//| const int nValue); // Logical value to be written in the file mapping.

//|10. The function opens the file mapping and writes the number of the CHAR type from the specified byte in memory into it.
//| If no file mapping exists, one is created. The function converts an INT number to CHAR for writing to the file mapping.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of data greater than allocated memory;
//| -2 initial address not received;
//| -3 value not written to memory;
//| -4 file mapping failure.
//| int FileMappingWriteCharValue(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the number will be written.
//| const int nValue); // An integer number to be written in the file mapping.

//|11. The function opens the file mapping and writes the number of the SHORT type from the specified byte in memory into it.
//| If there is no file mapping, one is created. The function converts an INT number to SHORT for writing to the file mapping.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of data greater than allocated memory;
//| -2 initial address not received;
//| -3 value not written to memory;
//| -4 file mapping failure.
//| int FileMappingWriteShortValue(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the number will be written.
//| const int nValue); // Integer number to be written to file mapping.

//|12. The function opens the file mapping and writes the number of INT type from the specified byte in memory into it.
//| If no file mapping exists, one is created.
//| Function returns: 1 successful completion;
//| 0 other errors; |
//| -1 data quantity is greater than allocated memory;
//| -2 initial address not received;
//| -3 value not written to memory;
//| -4 file mapping failure.
//| int FileMappingWriteIntValue(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the number will be written.
//| const int nValue); // An integer number to be written in the file mapping.

//|13. The function opens the file mapping and writes a number of FLOAT type from the specified byte in memory into it.
//| If there is no file mapping, one is created. The function converts a DOUBLE number to FLOAT for writing to the file mapping.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of data greater than allocated memory;
//| -2 initial address not received;
//| -3 value not written to memory;
//| -4 file mapping failure.
//| int FileMappingWriteFloatValue(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the number will be written.
//| const double dValue); // Double-precision number to be written in the file mapping.

//|14. The function opens a file mapping and writes the number of the DOUBLE type from the specified byte in memory into it.
//| If no file mapping exists, a file mapping is created.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of data greater than allocated memory;
//| -2 initial address not received;
//| -3 value not written to memory;
//| -4 file mapping failure.
//| int FileMappingWriteDoubleValue(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the number will be written.
//| const double dValue); // Number of double precision for writing to file mapping.

//|15. The function opens a file mapping and writes a string from the specified byte in memory into it. If there is no file mapping, one is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of characters to write more than the string length;
//| -2 string length more than allocated memory;
//| -3 start address not received;
//| -4 value in memory not written;
//| -5 cancel file mapping failed.
//| int FileMappingWriteString(const char *szNameFileMapping, //| name for projected file.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the string will be written.
//| const char *szString); // String for writing to file mapping.

//| FUNCTIONS TO WRITE NUMBERS AND STRINGS TO THE FILE MAPPING REPRESENTATION OF THE PROJECTED FILE IN THE ADDRESS SPACE OF THE CALLING PROCESS.

//|16. The function writes a logical BOOL value from the specified byte in memory to the file mapping at the start address space of the calling process.
//| The function is intended to be used in loops. The function converts a number of INT type to BOOL for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 no value is written to memory.
//| int FileMappingWriteSimpleBoolValue(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int nValue); // Logical value to write to the file mapping.

//|17. The function writes the number of the CHAR type from the specified byte in memory into the file mapping by the initial address of the calling process space.
//| The function is intended to be used in loops. The function converts an INT number to CHAR for writing to the file mapping.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of data greater than allocated memory;
//| -2 value not written to memory.
//| int FileMappingWriteSimpleCharValue(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int nValue); // Logical value to write to the file mapping.

//|18. The function writes a number of type SHORT from the specified byte in the memory into the file mapping by the initial address of the calling process space.
//| The function is intended to be used in loops. The function converts an INT type number to SHORT for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 no value is written to memory.
//| int FileMappingWriteSimpleShortValue(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int nValue); // logical value for writing to the file mapping.

//|19. The function writes the number of INT type from the specified byte in memory to the file mapping at the initial space address of the calling process.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 no value is written to memory.
//| int FileMappingWriteSimpleIntValue(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int nValue); // An integer number to write to the file mapping.
 
//|20. The function writes a number of type FLOAT to the file mapping at the initial space address of the calling process from the specified byte in memory.
//| The function converts a DOUBLE number to FLOAT for writing to the file mapping. The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 no value is written to memory.
//| int FileMappingWriteSimpleFloatValue(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const double dValue); // double precision number to write to the file mapping.

//|21. The function writes a DOUBLE-type number from the specified byte in memory into the file mapping on the initial address of the calling process space.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 no value is written to memory.
//| int FileMappingWriteSimpleDoubleValue(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const double dValue); // double precision number to write to the file mapping.

//|22. The function writes a string from the specified byte in memory to the file mapping at the initial space address of the calling process.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 no value is written to memory.
//| int FileMappingWriteSimpleString(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const char *szString); // A string to write to the file mapping.

//| FUNCTIONS TO READ NUMBERS AND STRINGS FROM THE FILE MAPPING.

//|23. The function opens a file mapping and reads from it a logical BOOL value from the specified byte in memory.
//| If the file mapping does not exist, it is created. The function returns the read value or FALSE in case of error.
//| bool FileMappingReadBoolValue(const char *szNameFileMapping, //Name for the file being projected.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte); // Number of bytes from the beginning of allocated memory, from which the number will be read.

//|24. The function opens a file mapping and reads from it a number of CHAR type from the specified byte in memory.
//| If there is no file mapping, one is created. The function returns the value read, or NULL if there is an error.
//| char FileMappingReadCharValue(const char *szNameFileMapping, //Name for the file being projected.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte); // Number of bytes from the beginning of allocated memory from which a number will be read.

//|25. The function opens a file mapping and reads from it a number of type SHORT from the specified byte in memory.
//| If there is no file mapping, one is created. The function returns the value read, or NULL if there is an error.
//| short FileMappingReadShortValue(const char *szNameFileMapping, //Name for the file being projected.
//| const int nMemorySize, // Amount of memory to be reserved for file mapping.
//| const int nStartByte); // Number of bytes from the beginning of allocated memory, from which a number will be read.

//|26. The function opens a file mapping and reads from it the number of INT type from the specified byte in memory.
//| If there is no file mapping, one is created. The function returns read value or NULL in case of error.
//| int FileMappingReadIntValue(const char *szNameFileMapping, //Name for the file being projected.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte); // Number of bytes from the beginning of allocated memory, from which a number will be read.

//|27. The function opens a file mapping and reads the number of the FLOAT type from the specified byte in the memory. If there is no file mapping, one is created.
//| The function returns the value read or NULL in case of error. The function converts a number of FLOAT type from file mapping to DOUBLE.
//| double FileMappingReadFloatValue(const char *szNameFileMapping, //Name for the file being projected.
//| const int nMemorySize, //Number of reserved memory for file mapping.
//| const int nStartByte); // Number of bytes from the beginning of allocated memory, from which the number will be read.

//|28. The function opens a file mapping and reads from it a number of DOUBLE type from the specified byte in memory.
//| If no file mapping exists, one is created. The function returns read value or NULL in case of error.
//| double FileMappingReadDoubleValue(const char *szNameFileMapping, //Name for the file being projected.
//| const int nMemorySize, // Amount of memory to be reserved for file mapping.
//| const int nStartByte); // Number of bytes from the beginning of allocated memory, from which the number will be read.

//|29. The function opens the file mapping and reads a line from it from the specified byte in memory. If there is no file mapping, one is created.
//| The function returns a pointer to the beginning of the string.
//| In case of an error, the function returns: "Error_1" string length is longer than allocated memory;
//| "Error_2" initial address not received;
//| "Error_3" message from memory not read;
//| "Error_4" file mapping failure.
//| char *FileMappingReadString(const char *szNameFileMapping, //Name for the projected file.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, from which the string will be read.
//| const int nLengthString); // Length of the string to be read in characters (bytes).

//| FUNCTIONS FOR READING NUMBERS AND STRINGS FROM THE PROJECTED FILE REPRESENTATION IN THE ADDRESS SPACE OF THE CALLING PROCESS.

//|30. The function reads from the file mapping to the initial address space of the calling process a logical BOOL value from the specified byte in memory.
//| The function is intended to be used in loops. The function returns a read value or FALSE in case of an error.
//| bool FileMappingReadSimpleBoolValue(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.

//|31. The function opens the file mapping and reads from it the number of the CHAR type from the indicated byte in the memory.
//| The function is intended to be used in loops. The function returns a read value or NULL in case of an error.
//| char FileMappingReadSimpleCharValue(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.

//|32. The function opens the file mapping and reads from it the number of the SHORT type from the specified byte in the memory.
//| The function is intended to be used in loops. The function returns a read value or NULL in case of an error.
//| short FileMappingReadSimpleShortValue(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.

//|33. The function opens the file mapping and reads from it the number of INT type from the indicated byte in the memory.
//| The function is intended to be used in loops. The function returns read value or NULL in case of error.
//| int FileMappingReadSimpleIntValue(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.

//|33. The function opens the file mapping and reads from it the number of INT type from the indicated byte in the memory.
//| The function is intended to be used in loops. The function returns read value or NULL in case of error.
//| int FileMappingReadSimpleIntValue(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.

//|34. The function opens the file mapping and reads from it the number of the FLOAT type from the indicated byte in the memory. The function is intended to be used in loops.
//| The function returns the value read or NULL in case of an error. The function converts a number of the FLOAT type from file mapping to DOUBLE.
//| double FileMappingReadSimpleFloatValue(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.

//|35. The function opens the file mapping and reads from it the number of the DOUBLE type from the indicated byte in the memory.
//| The function is intended to be used in loops. The function returns a read value or NULL in case of an error.
//| double FileMappingReadSimpleDoubleValue(const char *pcAddress); // Pointer to the byte of memory area of the projected file representation,
//| // from which the data will be written.

//|36. The function opens the file mapping and reads a line from it from the indicated byte in the memory. The function is intended to be used in loops.
//| The function returns a pointer to the beginning of the string.
//| In case of an error, the function returns: "Error_1" the length of the string exceeds the allocated memory;
//| "Error_2" the message from the memory is not read;
//| char *FileMappingReadSimpleString(const char *pcAddress); // Pointer to the byte of the memory area of the projected file representation,
//| // from which data recording will be performed.

//| FUNCTION TO WRITE ARRAYS TO THE FILE MAPPING.

//|37 The function opens a file mapping and writes an array with BOOL type data into it from the specified byte in memory.
//| If there is no file mapping, one is created. The function converts the INT array data to BOOL for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 initial address not received;
//| -4 array not written to memory;
//| -5 file mapping failure.
//| int FileMappingWriteBoolArray(const char *szNameFileMapping, //Name for the file mapping.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, which the array will be written from.
//| const int *aiArray, // Pointer to array with logical BOOL data to be written to file mapping.
//| const int nSizeBuffer); // Array size.

//|38. The function opens a file mapping and writes into it an array with CHAR-type data from the specified byte in memory.
If //| there is no file mapping, one is created. The function converts the INT array data to CHAR for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 initial address not received;
//| -4 array not written to memory;
//| -5 file mapping failure.
//| int FileMappingWriteCharArray(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, which the array will be written from.
//| const int *aiArray, // Pointer to array with CHAR-type data to be written to file mapping.
//| const int nSizeBuffer); // Array size.

//|39. The function opens a file mapping and writes an array with data of type SHORT from the specified byte in memory into it.
If //| there is no file mapping, one is created. The function converts the INT array data to SHORT for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 initial address not received;
//| -4 array not written to memory;
//| -5 file mapping failure.
//| int FileMappingWriteShortArray(const char *szNameFileMapping, //Name for the projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, which the array will be written from.
//| const int *aiArray, // Pointer to array with data of SHORT type to be written to file mapping.
//| const int nSizeBuffer); // Array size.
 
//|40. The function opens a file mapping and writes to it an array with INT type data from the specified byte in memory.
If //| there is no file mapping, it is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 initial address not received;
//| -4 array not written to memory;
//| -5 cancel file mapping failed.
//| int FileMappingWriteIntArray(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, which the array will be written from.
//| const int *aiArray, // Pointer to array with INT type data to be written to file mapping.
//| const int nSizeBuffer); // Array size.

//|41. The function opens the file mapping and writes an array with data of type FLOAT into it from the specified byte in memory.
If //| there is no file mapping, one is created. The function converts the array data DOUBLE to FLOAT for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 initial address not received;
//| -4 array not written to memory;
//| -5 file mapping failure.
//| int FileMappingWriteFloatArray(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, //Number of bytes from the beginning of allocated memory, //where the array will be written from.
//| const double *adArray, // Pointer to array with FLOAT type data to be written to file mapping.
//| const int nSizeBuffer); // Array size.

//|42. The function opens a file mapping and writes an array with data of the DOUBLE type from the specified byte in memory into it.
If //| There is no file mapping, one is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 initial address not received;
//| -4 array not written to memory;
//| -5 cancel file mapping failed.
//| int FileMappingWriteDoubleArray(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, //Number of bytes from the beginning of allocated memory, //where the array will be written from.
//| const double *adArray, // Pointer to array with DOUBLE-type data to be written to file mapping.
//| const int nSizeBuffer); // Array size.

//| FUNCTIONS TO WRITE ARRAYS TO THE FILE MAPPING REPRESENTATION OF THE PROJECTED FILE IN THE ADDRESS SPACE OF THE CALLING PROCESS.

//|43. The function writes an array with BOOL-type data from the specified byte in the memory into the file mapping by the initial address space of the calling process.
//| The function is intended to be used in loops. The function converts the INT array data to BOOL for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 array not written to memory.
//| int FileMappingWriteSimpleBoolArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int *aiArray, // Pointer to the array with logical BOOL data to be written to the file mapping.
//| const int nSizeBuffer); // Array size.

//|44. The function writes an array with BOOL-type data from the specified byte in the memory to the file mapping by the initial space address of the calling process.
//| The function is intended to be used in loops. The function converts the INT array data to CHAR for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 array not written to memory.
//| int FileMappingWriteSimpleCharArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int *aiArray, // Pointer to the array with CHAR-type data to be written to the file mapping.
//| const int nSizeBuffer); // Array size.

//|45. The function writes an array with BOOL-type data from the specified byte in the memory into the file mapping by the initial space address of the calling process.
//| The function is intended to be used in loops. The function converts the INT array data to SHORT for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write over array size;
//| -2 number of data over allocated memory;
//| -3 array not written to memory.
//| int FileMappingWriteSimpleShortArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int *aiArray, // Pointer to array with data of SHORT type to be written to the file mapping.
//| const int nSizeBuffer); // Array size.

//|46. The function writes an array with data of INT-type from the specified byte in the memory into the file mapping on the initial address of the calling process space. |
//| The function is intended to be used in loops.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 array not written to memory.
//| int FileMappingWriteSimpleIntArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const int *aiArray, // Pointer to the array with INT-type data to be written to the file mapping.
//| const int nSizeBuffer); // Array size.

//|47. The function writes an array with data of type FLOAT to the file mapping from the specified byte in the memory by the initial address of the calling process space.
//| The function is intended to be used in loops. The function converts the DOUBLE array data to FLOAT for writing to the file mapping.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than the array size;
//| -2 number of data more than allocated memory;
//| -3 no array is written to memory.
//| int FileMappingWriteSimpleFloatArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const double *adArray, // Pointer to array with data of FLOAT type to be written to the file mapping.
//| const int nSizeBuffer); // Array size.

//|48. The function writes an array with data of the DOUBLE type from the specified byte in memory to the file mapping by the initial space address of the calling process.
//| The function is intended to be used in loops.
//| Function returns: 1 successful completion;
//| 0 other errors;
//| -1 number of cells to write more than array size;
//| -2 number of data more than allocated memory;
//| -3 array not written to memory.
//| int FileMappingWriteSimpleDoubleArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| const double *adArray, // Pointer to array with data of DOUBLE type to be written to the file mapping.
//| const int nSizeBuffer); // Array size.

//| FUNCTIONS TO READ ARRAYS FROM THE FILE MAPPING.

//|49. The function opens a file mapping and reads from it data of the BOOL type into an array from the specified byte in memory.
//| If no file mapping exists, a file mapping is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the start address is not received;
//| -4 the message from memory is not read;
//| -5 cancel file mapping failed.
//| int FileMappingReadBoolArray(const char *szNameFileMapping, //| name for the file being mapped.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte, //Number of bytes from the beginning of allocated memory from which the array will be written.
//| int *aiArray, // Pointer to array for reading logical BOOL data from file mapping into it.
//| const int nSizeBuffer); // Array size.
 
//|50. The function opens a file mapping and reads data of CHAR type from it into an array from the specified byte in memory.
If //| there is no file mapping, it is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the start address is not received;
//| -4 the message from memory is not read;
//| -5 cancel file mapping failed.
//| int FileMappingReadCharArray(const char *szNameFileMapping, //Name for projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, //Number of bytes from the beginning of allocated memory from which the array will be written.
//| int *aiArray, // Pointer to array for reading CHAR-type data from file mapping.
//| const int nSizeBuffer); // Array size.

//|51. The function opens the file map and reads data of the SHORT type from it into the array from the specified byte in memory.
If //| There is no file mapping, one is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the start address is not received;
//| -4 the message from memory is not read;
//| -5 cancel file mapping failed.
//| int FileMappingReadShortArray(const char *szNameFileMapping, //Name for the projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, //Number of bytes from the beginning of allocated memory from which the array will be written.
//| int *aiArray, // Pointer to array for reading SHORT data from file mapping.
//| const int nSizeBuffer); // Array size.

//|52. The function opens the file map and reads data of INT type from it into the array from the specified byte in memory.
//| If there is no file mapping, one is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the start address is not received;
//| -4 the message from memory is not read;
//| -5 cancel file mapping failed.
//| int FileMappingReadIntArray(const char *szNameFileMapping, //| name for the file being mapped.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte, //Number of bytes from the beginning of allocated memory from which the array will be written.
//| int *aiArray, // Pointer to array for reading INT-type data from file mapping into it.
//| const int nSizeBuffer); // Array size.

//|53. The function opens a file mapping and reads data of FLOAT type from it into the array from the specified byte in memory.
If //| there is no file mapping, one is created. The function converts the data of type FLOAT from the file mapping to DOUBLE for reading into the array.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 no start address received;
//| -4 message from memory not read;
//| -5 undo file mapping failed.
//| int FileMappingReadFloatArray(const char *szNameFileMapping, //Name for the projected file.
//| const int nMemorySize, // Amount of reserved memory for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, // from which the array will be written.
//| double *adArray, // Pointer to array for reading FLOAT-type data from file mapping.
//| const int nSizeBuffer); // Array size.

//|54. The function opens a file mapping and reads data of DOUBLE type from it into an array from the specified byte in memory.
//| If there is no file mapping, one is created.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the starting address is not received;
//| -4 the message from memory is not read;
//| -5 cancel file mapping failed.
//| int FileMappingReadDoubleArray(const char *szNameFileMapping, //| name for the projected file.
//| const int nMemorySize, // Amount of memory to reserve for file mapping.
//| const int nStartByte, // Number of bytes from the beginning of allocated memory, // from which the array will be written.
//| double *adArray, // Pointer to array for reading DOUBLE data from file mapping.
//| const int nSizeBuffer); // Array size.

//| FUNCTION TO READ ARRAYS IN THE FILE MAPPING REPRESENTATION OF THE PROJECTED FILE IN THE ADDRESS SPACE OF THE CALLING PROCESS.

//|55. The function reads data of BOOL type from the file mapping by the initial address space of the calling process into an array from the specified byte in memory.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 message from memory not read.
//| int FileMappingReadSimpleBoolArray(const char *pcAddress, // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| int *aiArray, // Pointer to the array for reading logical BOOL data into it from the file mapping.
//| const int nSizeBuffer); // Array size.

//|56. The function reads data of CHAR type from the file mapping by the initial address of the calling process space into an array from the specified byte in the memory.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the message from memory is not read.
//| int FileMappingReadSimpleCharArray(const char *pcAddress, // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| int *aiArray, // Pointer to the array for reading CHAR-type data from the file mapping.
//| const int nSizeBuffer); // Array size.

//|57. The function reads data of type SHORT from the file mapping by the initial address of the calling process space into the array from the specified byte in memory.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the message from memory is not read.
//| int FileMappingReadSimpleShortArray(const char *pcAddress, // Pointer to byte of memory area of projected file representation,
//| // from which data will be written.
//| int *aiArray, // Pointer to array for reading data of SHORT type from the file mapping into it.
//| const int nSizeBuffer); // Array size.

//|58. The function reads data of INT type from the file mapping by the initial space address of the calling process into the array from the specified byte in memory.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 the message from memory is not read.
//| int FileMappingReadSimpleIntArray(const char *pcAddress, // Pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| int *aiArray, // Pointer to the array for reading INT type data from the file mapping into it.
//| const int nSizeBuffer); // Array size.

//|59. The function reads data of FLOAT-type from the file mapping by the initial address of the calling process space into the array from the specified byte in the memory.
//| The function is intended to be used in loops. The function converts the data of file mapping type FLOAT to DOUBLE for reading into an array.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 message from memory not read.
//| int FileMappingReadSimpleFloatArray(const char *pcAddress, //| pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| double *adArray, // pointer to the array for reading FLOAT-type data from the file mapping into it.
//| const int nSizeBuffer); // Array size.

//|60. The function reads data of DOUBLE type from the file mapping by the initial space address of the calling process into the array from the specified byte in memory.
//| The function is intended to be used in loops.
//| The function returns: 1 successful completion;
//| 0 other errors;
//| -1 more data than allocated memory;
//| -2 the size of the receiving buffer is not sufficient;
//| -3 message from memory not read.
//| int FileMappingReadSimpleDoubleArray(const char *pcAddress, // pointer to the byte of the memory area of the projected file representation,
//| // from which the data will be written.
//| double *adArray, // pointer to the array for reading DOUBLE-type data from the file mapping into it.
//| const int nSizeBuffer); // Array size.
 
Zhunko >>:
Это не исходник, и не DLL. Это офрмленный заголовок исходника DLL, на который потратил больше недели. Написание класса для маппинга заняло неделю. В основном на продумывание структурированности.
А само писание 60 функций заняло 60 минут. Там в каждой функции по паре строчек.
It's a very nice library. Can't you share the finished files? Or does it involve payment?
 
Andrei01 >>:
Очень приятная библиотечка. А файлами готовыми Вы не можете поделиться? Или это подразумевает оплату?

Not finished yet. Everything is in process. I am correcting errors in description and editing function names, they are too long for MQL4.
Testing is a long way off. The library is intended to work with my Toolbox and therefore it is protected. I will not give you the source code.
If you want, you may rent it. :-))
But, after all, the most valuable things you have laid out. This description is more important than the source code.

 
3/4 tested. Figured out that we need to add 16 more functions for unsigned integers, except INT.
At the moment the header file looks like this:
Files:
 
Finished. 80 functions now. Put it in the piggy bank. Probably will appear soon.
The header file is now like this:
Files:
 
Zhunko: Всё-таки, общение через файлы это не тот инструмент. Не по назначению.
Файлы придуманы для длительного хранения информации. Зачем терзать диск? Для общения есть ОЗУ.

If you create a disk in RAM (RAMdisk), then the hard drive will not suffer and offer JavaDev makes a certain sense.

And for the library - thank you very much!!! Just a masterpiece!!!

Reason: