Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A little experiment: WinBoard and Visual Basic

Author: Ian Osgood

Date: 08:55:37 07/16/99

Go up one level in this thread


On July 16, 1999 at 09:43:28, Luca Dormio wrote:

>This topic was discussed some days ago in the italian newsgroup it.hobby.scacchi
>(scacchi=chess); since i was interested in making some chess related stuff in VB
>such as an interface for winboard engines and/or a conversion of a simple engine
>from another language i've recently started some tests on communication
>protocol.

...

> the problem is that i can't send a command back to WB, i've tried with:
>
>CommandStr = CommandStr & vbLf 'terminate command with a \n
>lBytes = LenB(CommandStr)
>rc = WriteFile(hStdOut, ByVal CommandStr, lBytes, lBytesWritten, ByVal 0&)
>
>and with:
>
>CommandStr = CommandStr & vbLf 'terminate command with a \n
>lBytes = LenB(CommandStr)
>SetFilePointer hStdOut, 0&, 0&, FILE_BEGIN
>rc = WriteFile(hStdOut, ByVal CommandStr, lBytes, lBytesWritten, ByVal 0&)
>SetEndOfFile hStdOut
>
>but doesn't work either way, WB doesn't react to my command string (without
>showing any warning); since the WriteFile API returns 0 (success) i probably
>fail to do something else, any advice?
>
>Thanks in advance
>Luca

Try using the FlushFileBuffers function after you call WriteFile.  Otherwise,
output will be held until the internal buffer is full.

Ian Osgood
author of two WinBoard engines



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.