Skip to content

Instantly share code, notes, and snippets.

@zvukoper
Created February 27, 2011 13:40
Show Gist options
  • Save zvukoper/846192 to your computer and use it in GitHub Desktop.
Save zvukoper/846192 to your computer and use it in GitHub Desktop.
Part of the code to show how I open the pipe
procedure TAAR_client.FormShow(Sender: TObject);
const
OpenMode = PIPE_ACCESS_DUPLEX or FILE_FLAG_OVERLAPPED;
PipeMode = PIPE_TYPE_MESSAGE or PIPE_READMODE_MESSAGE or PIPE_WAIT;
Instances = PIPE_UNLIMITED_INSTANCES;
begin
Console.Lines.Add('OK: Starting thread');
AAR := TAARThread.Create(False);
AAR.Priority := tpLowest;
delphiCom := CreateNamedPipe(
PChar('\\.\pipe\delphiCom'), OpenMode, PipeMode,
Instances,
1024,
1024,
1000,
nil);
if delphiCom = INVALID_HANDLE_VALUE then
begin
Console.Lines.Add('No delphiCom pipe');
end
else
begin
Console.Lines.Add('OK: delphiCom opened')
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment