Hi,
I am relatively new to PB (used VB for years before) so may be a "stupid" question
. I created two programs in PB Win 8, one creating an anonynous pipe, another one reading it. Comes basically from Appleman. The programs run without errors, the only problem is that the string that I write to the pipe is not read that way by the client.
PeekNamedPipe correctly detects that there is text in the pipe, including the number of bytes, ReadFile reads the number of bytes and stores it in the variable I want but this is not the text that the server sends. I guess it has something to do with character sets but I have no idea to convert what into what. Appleman (for VB) says the output has to be converted into unicode but as far as I know VB handles string internally different than PB, or am I wrong?
Chunk of code:
RetValL=PeekNamedPipe(hPipeRead,ByVal 0&,0,nRead,nAvail,nMessage)'this works
If nAvail>0 Then
T$=Space$(nAvail)
RetValL=ReadFile(hPipeRead, ByVal StrPtr(T$),nAvail,nRead,ByVal 0)'this returns something, but what?
MsgBox "text: " & T$ 'something ununderstandably
End If
Any suggestions?
Wilko
I am relatively new to PB (used VB for years before) so may be a "stupid" question

PeekNamedPipe correctly detects that there is text in the pipe, including the number of bytes, ReadFile reads the number of bytes and stores it in the variable I want but this is not the text that the server sends. I guess it has something to do with character sets but I have no idea to convert what into what. Appleman (for VB) says the output has to be converted into unicode but as far as I know VB handles string internally different than PB, or am I wrong?
Chunk of code:
RetValL=PeekNamedPipe(hPipeRead,ByVal 0&,0,nRead,nAvail,nMessage)'this works
If nAvail>0 Then
T$=Space$(nAvail)
RetValL=ReadFile(hPipeRead, ByVal StrPtr(T$),nAvail,nRead,ByVal 0)'this returns something, but what?
MsgBox "text: " & T$ 'something ununderstandably
End If
Any suggestions?
Wilko
Comment