Re[7]: HELP2: Еще один вопрос по pipe
От: SCS  
Дата: 26.11.02 10:31
Оценка:
Здравствуйте, Baggy, Вы писали:

это из MSDN для подключения клиента
while (1) 
   { hPipe = CreateFile( 
         lpszPipename,   // pipe name 
         GENERIC_READ |  // read and write access 
         GENERIC_WRITE, 
         0,              // no sharing 
         NULL,           // no security attributes
         OPEN_EXISTING,  // opens existing pipe 
         0,              // default attributes 
         NULL);          // no template file 
   // Break if the pipe handle is valid.  
      if (hPipe != INVALID_HANDLE_VALUE) 
         break; 
      // Exit if an error other than ERROR_PIPE_BUSY occurs. 
      if (GetLastError() != ERROR_PIPE_BUSY) 
         MyErrExit("Could not open pipe"); 
      // All pipe instances are busy, so wait for 20 seconds. 
      if (! WaitNamedPipe(lpszPipename, 20000) ) 
         MyErrExit("Could not open pipe"); 
   } 
 
// The pipe connected; change to message-read mode.
SCS
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.