From the post "http://www.forexfactory.com/showthread.php?t=125117", I was inspired with the idea to use namepipe to communicate with Excel.
However, when I run the following script in MT4, I always receive an alert "CreateNamedPipe failed". What did I do wrong?
int hPipe = CreateNamedPipeA
ANSI version when strings are now Unicode
Thank for reply. Since I am a beginner of C++ programming, I still don't know how to fix the problem.
Can you tell me how to modify the code so that it can be run in MT4?
Hi, Everything is ok. But "inString" gets only first character of comming text. What should I have to change? Please help.
bool fSuccess = ReadFile(hPipe,inBuffer,4*ArraySize(inBuffer),bytesRead,NULL) !=0; if (!fSuccess || (bytesRead[0] == 0)) break; string inString=""; for(int i=0; i<bytesRead[0]; i++) inString = inString + CharToStr( (inBuffer[i/4] >> ((i & 3)*8)) & 0xff); lastMessage = "Last message from client: "+inString; string outString = "Received ["+inString+"]";
I also am facing the same problem .. the server only receive first character of the string. This is crazy from meta-qoutes not to maintain backward compatibilities in build 600+. That means we have to code all over again to make our running code compatible with their new builds .. crazy .. In build 600+ there is an example of pipes which totally uses different logic, structures etc. I know the problem is with this loop but don't know how to solve
for(int i=0; i<bytesRead[0]; i++) inString = inString + CharToStr( (inBuffer[i/4] >> ((i & 3)*8)) & 0xff);
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
From the post "http://www.forexfactory.com/showthread.php?t=125117", I was inspired with the idea to use namepipe to communicate with Excel.
However, when I run the following script in MT4, I always receive an alert "CreateNamedPipe failed". What did I do wrong?