기고글 토론 "Named Pipes를 사용하여 MetaTrader 5 터미널 간 통신을 위한 DLL없는 솔루션" - 페이지 3

 
mql4/5에는 멀티 스레딩 가능성이 없다는 사실을 고려할 때 mql4/5에서 서버를 만드는 것은 튜브 TV를 보는 것과 같습니다 (작동하는 것 같지만 느낌은 같지 않습니다. 따라서 별도의 서버를 작성하고이를 사용하여 mql 프로그램간에 데이터를 전송하는 데 사용하는 것이 좋습니다.
 
안녕하세요, 이 제품이 여전히 작동하나요? 그렇지 않다면 최신 MT5 빌드에서 작동하도록 업데이트할 수 있나요? 지금은 '액세스 위반'이 발생하고 있습니다.
 

또한 쓰기 틱, 읽기 틱... 등의 메서드를 호출 할 때 액세스 위반 오류가 발생했습니다. 첨부된 수정된 CNamedPipes 파일을 찾아보세요.

또한 CNamedPipe 클래스에WriteDouble 메서드를 추가했습니다 :

#import "kernel32.dll"
...
int WriteFile(ulong fileHandle,double &var,int bytes,int &numOfBytes,ulong overlapped);
...
#import

...

bool CNamedPipe::WriteDouble(double data)
  {
   int data_size = sizeof(data);
//--- 매개변수 확인
   if(!data || data_size<1) return(false);

//--- 데이터 보내기
   int written;
   if(!WriteFile(hPipe,data,data_size,written,NULL) || written!=data_size)
      return(false);
//--- ok
   return(true);
  }


참고: 클라이언트 측(예: 다른 메타트레이더 터미널)에서 읽기/쓰기를 하려면 표준 MQL5 파일파이프 라이브러리를 사용했습니다. 사용 방법은 여기에서 예제를 다운로드할 수 있습니다:


https://www.mql5.com/ko/articles/503

Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
  • www.mql5.com
Many developers face the same problem - how to get to the trading terminal sandbox without using unsafe DLLs. One of the easiest and safest method is to use standard Named Pipes that work as normal file operations. They allow you to organize interprocessor client-server communication between programs. Take a look at practical examples in C++ and MQL5 that include server, client, data exchange between them and performance benchmark.
파일:
 
환상적인 작업
 
여기에 업데이트가 된 지 꽤 오래되었는데... 차트에 인디케이터를 첨부할 때 "액세스 위반" 오류가 발생합니다. 이걸 작동시킬 방법이 없는 것 같네요.