Article View: borland.public.cppbuilder.nativeapi
Article #8423Connecting named pipes
From: nicolasr
Date: Sun, 31 Oct 2004 02:07
Date: Sun, 31 Oct 2004 02:07
61 lines
2300 bytes
2300 bytes
Hi,
I'm trying to connect to a named pipe on XP (SP2) from
Win98.
When XP has the firewall activated the Win98 client
can't connect. Error:
"Network path not found" (translation from german...)
I know this is not a programming question but does
anyone know how I do configure the firewall such that
the client has access? I tried to select the client app in
the firewall configuration dialog but that doesn't change
anything.
If I deactivate the firewall I get the error:
"Access denied"
Here is the client code:
void __fastcall TForm2::Button1Click(TObject *Sender)
{
const char* pipeName = "\\\\192.168.0.1\\pipe\\MyPipe";
HANDLE pipe = CreateFile(
pipeName, // pipe name
GENERIC_READ | // read and write access
GENERIC_WRITE,
0, // no sharing
NULL, // no security attributes
OPEN_EXISTING, // opens existing pipe
0,
NULL);
Win32Check(pipe != INVALID_HANDLE_VALUE);
try
{
DWORD written;
char* inBuf = "Hello";
char outBuf[256];
DWORD bufSize = strlen(inBuf);
DWORD read;
Win32Check(WriteFile(pipe, inBuf, bufSize, &written, NULL));
Win32Check(ReadFile(pipe, outBuf, 255, &read, NULL));
outBuf[read] = '\0';
ShowMessage(outBuf);
}
__finally
{
Win32Check(CloseHandle(pipe));
}
}
thanks for any idea,
Nick
Technical Details
Message-ID:
<418448ff$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7f4edb9d9ca3ade,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Connecting named pipes Date: Sun, 31 Oct 2004 03:07:56 +0100 Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 80.133.178.158 Message-ID: <418448ff$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1099188479 80.133.178.158 (30 Oct 2004 19:07:59 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail