% S mailslot msclient", Buf);
SendMailslotHandle = CreateFile (BufConnect, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (SendMailslotHandle == INVALID_HANDLE_VALUE)
{
Application-> MessageBox ("Помилка при відкритті mailslot "," Помилка ", MB_OK + MB_ICONHAND);
Application-> Terminate ();
}
char * StrPered = DannieToChar (0, KolKub, MaxOch);
MailSlotSend (strPered);
InterfaceBeginNewGame ();
ChangeInterfacePerehodHoda (1);
}
else
{
Priem (CharToMas (Buf));
}
}
}
delete [] BufExchange;
}
// ------------------------ відправка -------------------- --------------------------
void __ fastcall TMainForm :: MailSlotSend (char * Buf)
{
unsigned long cbWritten;
char BufExchange [100];
MyCurrNomMessage + +;
itoa (MyCurrNomMessage, BufExchange, 10);
strcat (BufExchange, ";");
strcat (BufExchange, Buf);
WriteFile (SendMailslotHandle, BufExchange, strlen (BufExchange) +1, & cbWritten, NULL);
}
// ---------------------- розрив з'єднання ---------------------------------------
void __ fastcall TMainForm :: MailSlotCloseConnection (void)
{
CloseHandle (SendMailslotHandle);
CloseHandle (ReceiveMailslotHandle);
TimerMailSlot-> Enabled = false;
MyCurrNomMessage = 0;
HisPrevNomMessage = 0;
}