Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Named Pipes und MS Virtual PC (https://www.delphipraxis.net/29298-named-pipes-und-ms-virtual-pc.html)

neolithos 7. Sep 2004 10:45


Named Pipes und MS Virtual PC
 
Ich versuche derzeit die Umleitung vom Com1 im Virtual PC auszulesen.
Leider ist mir das noch nicht gelungen.

Hat irgendjemand mit Pipes Erfahrung?
Vielleicht sogar im Zusammenhang mit Virtual PC!

neolithos 8. Sep 2004 14:46

Re: Named Pipes und MS Virtual PC
 
Da sich bis jetzt noch keiner gefunden hat, der einen Tip hat.

Hier ist mein Versuch:

Delphi-Quellcode:
var dwMode,
    dw,
    hPipe : Cardinal;
    ch : char;
begin
  hPipe := CreateFile(
    '\\.\pipe\my_com1',
    GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING,
    FILE_FLAG_WRITE_THROUGH, 0);
  if hPipe = INVALID_HANDLE_VALUE then
     RaiseLastOSError;
  Writeln('H: ', hPipe);
  try
    dwMode := PIPE_READMODE_BYTE or PIPE_WAIT;
    if not SetNamedPipeHandleState(hPipe, dwMode, nil, nil) then
       RaiseLastOSError;
    repeat
      if not ReadFile(hPipe, ch, 1, dw, nil) then
         Writeln('err');
      Writeln('R: ', ch, ' ### ', dw);
    until ch <> #27;
  finally
    CloseHandle(hPipe);
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz