'p2, execute after p1.bas:server 
'option explicit 
#include once "windows.bi" 
Dim as HANDLE ph,cf 
dim as string pn 
dim as integer res,werr,pcount 
dim as string pout 

pn="\\.\PIPE\tpipe" 
cf=CreateFile(strptr(pn),_ 
    GENERIC_WRITE,_ 
    FILE_SHARE_WRITE, _
    NULL,_ 
    OPEN_EXISTING,_ 
    FILE_ATTRIBUTE_NORMAL,_ 
    NULL) 

print "CreateFile: ";"Handle: ";cf
if cf = INVALID_HANDLE_VALUE then
  werr=GetLastError() '0 
  print "ERR: ";werr
  sleep
  end
end if

pout="Yeah, this should work now ..." 

res=WriteFile(cf,_ 
    strptr(pout),_ 
    len(pout),_ 
    @pcount,_ 
    NULL) 
Print " WriteFile: ";res
if res <> 0 then
  print "  BytesOut: ";pcount '14 bytes written 
else
  werr=GetLastError() '0 
  print "WriteFile ERR: ";werr
end if
sleep
print 
closehandle(cf)
 