Hi guys,

I am working with a chess engine and trying to establish communication between my VB6 program and the engine.

The engine does not accept parameters as input, I need to send a series of commands to the engine, capture the output (I found a way to do that already, but new suggestions are most welcome! the engine doesn't produce text file though), run another command and so on.

The matter is that with another engine I was working, I could simply call the name of the engine using Shell command, along with parameters that I needed, and write them into the file.

I already tried Batch files, it doesn't work because apparently when I run the engine, it takes a few moments before it gets ready for the next command, so it ignores the second command from the batch file.

One possible way I was thinking of was to call the engine from VB6 shell, then send another command to the particular console again, how is it possible? I would explain more in details so you can get what I am looking for:

1. Call Engine.exe
'The engine console is opened now, after 2 seconds it's ready to accept another command
2. Send another command to the engine to get ready (the console that has been opened already)
'This command also takes a few seconds (depending on a few factors) to respond.
3. Send a chess position and get the results back (another command to the opened console)
'This command could take up to 30 seconds depending on lots of factors.


My main concern is not about the delays, I can handle them with a flag check or something, now the point is how do I identify the opened console, and send another command to it.


Thanks for any opinion!
Ali.