Моделювання однофазної системи, Детальна інформація
Моделювання однофазної системи
hWnd, 0, &dwTread2ID);
if(hClient1Thread==NULL || hClient2Thread==NULL)
{
MessageBox(NULL, "Can't create client threads", "Kursova", 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
//create server thread
hServerThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)ServerThread,
hWnd, 0, &dwServerID);
if(hServerThread == NULL)
{
MessageBox(NULL, "Can't create server thread", "Kursova", 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
//create timer
uTimerID = SetTimer(0, 0, 1000, TimerProc);
if(uTimerID==NULL)
{
MessageBox(NULL, "Can't create timer", "Kursova", 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
hMainWindow = hWnd;
break;
case WM_CLOSE:
TerminateThread(hServerThread, 0);
TerminateThread(hClient1Thread, 0);
TerminateThread(hClient2Thread, 0);
CloseHandle(hSemaphore);
KillTimer(0, uTimerID);
if(hClient1Thread==NULL || hClient2Thread==NULL)
{
MessageBox(NULL, "Can't create client threads", "Kursova", 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
//create server thread
hServerThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)ServerThread,
hWnd, 0, &dwServerID);
if(hServerThread == NULL)
{
MessageBox(NULL, "Can't create server thread", "Kursova", 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
//create timer
uTimerID = SetTimer(0, 0, 1000, TimerProc);
if(uTimerID==NULL)
{
MessageBox(NULL, "Can't create timer", "Kursova", 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
hMainWindow = hWnd;
break;
case WM_CLOSE:
TerminateThread(hServerThread, 0);
TerminateThread(hClient1Thread, 0);
TerminateThread(hClient2Thread, 0);
CloseHandle(hSemaphore);
KillTimer(0, uTimerID);
The online video editor trusted by teams to make professional video in
minutes
© Referats, Inc · All rights reserved 2021