Quote:
|
Originally Posted by Beluck
well done  , but file functions (as well as many other) may be used directly from windows API dlls.
example of file copy function import:
#import "Kernel32.dll"
bool CopyFileA (string source_file, string destination_file, bool if_exist);
with DLLs you can do a lot of things, like SQL database access and so on.
|
Beluck,
That's right

, but could you give me
.mql demo shows me how to use the kernel32 functions
CreateFile,
OpenFile,
WriteFile and
ReadFile in MQL4
Code:
HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile
);
HFILE OpenFile(
LPCSTR lpFileName,
LPOFSTRUCT lpReOpenBuff,
UINT uStyle
);
BOOL WriteFile(
HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped
);
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);