-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMultThread.cpp
More file actions
54 lines (46 loc) · 900 Bytes
/
MultThread.cpp
File metadata and controls
54 lines (46 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
HANDLE hThread;
DWORD ThreadID;
hThread=CreateThread(NULL,
0,
(LPTHREAD_START_ROUTINE)ThreadFunc,
m_pFCarryer,
0,
&ThreadID);
void ThreadFunc(LPVOID lpParam)
{
CoInitialize(NULL);
CMFuncFCarryer *pFCarryer=(CMFuncFCarryer *)lpParam;
while(m_bRun)
{
pFCarryer->CarryFileForConvert();
Sleep(500);
}
CoUninitialize();
}
void CSATMQDlg::OnButtonstop()
{
// TODO: Add your control notification handler code here
//KillTimer(1);
g_bRun=false;
DWORD nExitCode;
while(1)
{
if (handleAlarmSend!=INVALID_HANDLE_VALUE)
{
GetExitCodeThread(handleAlarmSend,&nExitCode);
if (nExitCode==STILL_ACTIVE)
{
continue;
}
}
if (handleAlarmGenerate!=INVALID_HANDLE_VALUE)
{
GetExitCodeThread(handleAlarmGenerate,&nExitCode);
if (nExitCode==STILL_ACTIVE)
{
continue;
}
}
break;
}
}