I have already tried that. The thing is, I have a c++ program that receives the asset price from the mql program and send the commands(buy or sell) back to it. Since they both need to access same files(price file and command file), the so called "meta state" error may happen. Inter process communication methods are my only hope.
int CreateNamedPipeW(string pipeName, int openMode, int pipeMode, int maxInstances, int outBufferSize, int inBufferSize, int defaultTimeOut, int security);
bool ConnectNamedPipe(int hPipe, int overlapped);
bool ReadFile(int hPipe, char& inBuffer[], int NumberOfBytesToRead, int& bytesRead[], long lpOverlapped);
bool WriteFile(int hPipe, char& sBuffer[], int NumberOfBytesToWrite, int& bytesWritten[], long lpOverlapped);
bool CloseHandle(int hPipe);
#import
for some unknown reason, this has to be a bug the code worked fine
then i added a line of code after CreateNamedPipeW and then the code failed on line CreateNamedPipeW
this of course makes no sense at all, i tried disabling the compiler optimizer and a lot of other stuff
after a lot of trial and error debugging i found placing CreateNamedPipeW in OnInit solved it (had it in OnTimer first)
i never found a solution online, and a lot of people are facing this problem
"access violation" error is killing me too. Did you manage to fix it? I would really appreciate
I have been having this issue too.
i use my own imports (had to trial and error the parameters)
#define INVALID_HANDLE_VALUE -1
#define PIPE_TYPE_MESSAGE 4
#define PIPE_READMODE_MESSAGE 2
#define PIPE_WAIT 0
#define PIPE_ACCESS_DUPLEX 3
#import "kernel32.dll"
int CreateNamedPipeW(string pipeName, int openMode, int pipeMode, int maxInstances, int outBufferSize, int inBufferSize, int defaultTimeOut, int security);
bool ConnectNamedPipe(int hPipe, int overlapped);
bool ReadFile(int hPipe, char& inBuffer[], int NumberOfBytesToRead, int& bytesRead[], long lpOverlapped);
bool WriteFile(int hPipe, char& sBuffer[], int NumberOfBytesToWrite, int& bytesWritten[], long lpOverlapped);
bool CloseHandle(int hPipe);
#import
for some unknown reason, this has to be a bug the code worked fine
then i added a line of code after CreateNamedPipeW and then the code failed on line CreateNamedPipeW
this of course makes no sense at all, i tried disabling the compiler optimizer and a lot of other stuff
after a lot of trial and error debugging i found placing CreateNamedPipeW in OnInit solved it (had it in OnTimer first)
i never found a solution online, and a lot of people are facing this problem
so here is the solution :)
try with this...