摘要:
开始将buffer大小设为256,结果读取的消息不完整,缺少一些字符,后来将buffer设大点问题就解决了。function TfrmMain.ReadFromPipe(Pipe: THandle): string;var Buffer: PChar; BytesRead: DWORD; ReadBuffer: Cardinal;begin Result:= ''; if GetFileSize(Pipe, nil) = 0 then Exit; ReadBuffer:= 2560; Buffer := AllocMem(ReadBuffer);// Buffer:= Allo 阅读全文