Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using pipes in vb6

Status
Not open for further replies.

hmassink

Programmer
Jan 14, 2007
3
NL
Dear People,

I wrote a chessdatabaseprogram (vb6 en Acces2000), which is working fine.
Next step I want te make is the use of an Chess Engine for analyzing position within my chessdatabaseprogram. Theoretically this should be no problem because on Internet there are a lot of very strong free chessprograms. Communication with these programs can by done with the UCI protocol. In practice I spent a lot of time in trying to do so, but it does not seem to work. I think the problem is that communicating with the chessprogram has to made with “pipes” . Pipes is not vb6 , I’ am not really understanding the use of pipes. I looked for examples of the use of pipes, tried to use them, but it did not work.

Short description of the UCI protocol can by found at Complete protocol can by download at An example of a UCI engine (with source in C) can by found at
 



Hi,

In some other programming languages the double pipe || is the concatenation character.
Code:
(sString1 & sString2 = sString1 || sString2)
is TRUE.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
I think OP is asking about Named Pipes - so I'll just stand back and wait for strongm or hypetia to come along...

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
>has to made with “pipes”

Actually a quick look at the UCI protocol suggests that what you should actually be investigating are the standard streams: STDIN and STDOUT

The 'piping' bit simply comes in when we need to redirect input and output to and from these streams from our VB program.

We've covered how to gain access to and use these in VB on a number of occassions (VB normally does not have these streams at all), so a quick search in this forum should find some appropriate guidance from myself and others.

The bigger problem is that the protocol documents do not really spell out how the UCI end of the conversation works, and you will have to track down the STDIN and STDOUT that you need to talk to (clearly a multitasking GUI may have any number of applications with their own standard streams.

Typically, however, we'd probably expect the server to have a console window which we could search for by title or, if we know the process ID we can use AttachConsole (as far as I recall AttachConsole is illustrated in at least one of my examples, but you should be aware that it is only available in W2K onwards)
 
Strongm,
I have found the thread om STDIN en STDOUT.
I'am going to give it a try.

When I start the chess-engine (directly) a console-window appears, I can give commando's to the chessprogram, by typing them in the console.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top