• 大小: 0.26M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-02-20
  • 标签: 共享  内存  

资源简介


资源截图

代码片段和文件信息

#include “stdafx.h“
#include “cMyThread.h“

CMutex g_cMutex;

cMyThread::cMyThread()
{
m_hThread = NULL;
m_hWakeupEvent = NULL;
}


cMyThread::~cMyThread()
{
}

bool cMyThread::Init()
{
m_hWakeupEvent = CreateEvent(NULL TRUE FALSE NULL);
if (m_hWakeupEvent ==NULL)
{
return false;
}

m_hThread = CreateThread(NULL 0 &cMyThread::TestThread this CREATE_SUSPENDED NULL);
if (NULL == m_hThread)
{
return false;
}

ResumeThread(m_hThread);
return true;
}

bool cMyThread::UnInit()
{
m_hThread = CreateThread(NULL 0 &cMyThread::TestThread this CREATE_SUSPENDED NULL);
if (NULL != m_hThread)
{
WaitForSingleobject(m_hThread 100);
CloseHandle(m_hThread);
m_hThread = NULL;
}

return true;
}

DWORD CALLBACK cMyThread::TestThread(LPVOID lpParam)
{
if (lpParam == NULL)
{
return 0;
}
cMyThread*lpThis = (cMyThread*)lpParam;
return lpThis->TestProc();
}

DWORD cMyThread::TestProc()
{
while (true)
{

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     48640  2020-07-31 00:02  MFCApplication12\.vs\MFCApplication12\v14\.suo

     文件       1300  2020-07-29 00:38  MFCApplication12\MFCApplication12\cMyThread.cpp

     文件        279  2020-07-28 23:43  MFCApplication12\MFCApplication12\cMyThread.h

     文件     109252  2020-07-29 23:52  MFCApplication12\MFCApplication12\MFCApplication12.aps

     文件       2500  2020-07-28 21:20  MFCApplication12\MFCApplication12\MFCApplication12.cpp

     文件        503  2020-07-28 21:20  MFCApplication12\MFCApplication12\MFCApplication12.h

     文件      11466  2020-07-29 23:52  MFCApplication12\MFCApplication12\MFCApplication12.rc

     文件      10909  2020-07-29 23:52  MFCApplication12\MFCApplication12\MFCApplication12.vcxproj

     文件       2302  2020-07-28 23:43  MFCApplication12\MFCApplication12\MFCApplication12.vcxproj.filters

     文件       5159  2020-07-31 00:02  MFCApplication12\MFCApplication12\MFCApplication12Dlg.cpp

     文件       1021  2020-07-30 23:13  MFCApplication12\MFCApplication12\MFCApplication12Dlg.h

     文件       4207  2020-07-28 21:20  MFCApplication12\MFCApplication12\ReadMe.txt

    .......     67777  2015-07-06 21:54  MFCApplication12\MFCApplication12\res\MFCApplication12.ico

     文件        688  2020-07-28 21:20  MFCApplication12\MFCApplication12\res\MFCApplication12.rc2

     文件       1526  2020-07-29 23:09  MFCApplication12\MFCApplication12\resource.h

     文件        149  2020-07-28 21:20  MFCApplication12\MFCApplication12\stdafx.cpp

     文件       1578  2020-07-28 21:20  MFCApplication12\MFCApplication12\stdafx.h

     文件        240  2020-07-28 21:20  MFCApplication12\MFCApplication12\targetver.h

     文件       1330  2020-07-28 21:20  MFCApplication12\MFCApplication12.sln

    ..A..H.     39424  2020-07-31 00:02  MFCApplication13\.vs\MFCApplication13\v14\.suo

     文件     109316  2020-07-30 00:03  MFCApplication13\MFCApplication13\MFCApplication13.aps

     文件       2500  2020-07-29 23:23  MFCApplication13\MFCApplication13\MFCApplication13.cpp

     文件        503  2020-07-29 23:23  MFCApplication13\MFCApplication13\MFCApplication13.h

     文件      11592  2020-07-30 00:03  MFCApplication13\MFCApplication13\MFCApplication13.rc

     文件      10825  2020-07-30 00:03  MFCApplication13\MFCApplication13\MFCApplication13.vcxproj

     文件       2118  2020-07-29 23:23  MFCApplication13\MFCApplication13\MFCApplication13.vcxproj.filters

     文件       5589  2020-07-31 00:02  MFCApplication13\MFCApplication13\MFCApplication13Dlg.cpp

     文件       1031  2020-07-30 23:38  MFCApplication13\MFCApplication13\MFCApplication13Dlg.h

     文件       4207  2020-07-29 23:23  MFCApplication13\MFCApplication13\ReadMe.txt

    .......     67777  2015-07-06 21:54  MFCApplication13\MFCApplication13\res\MFCApplication13.ico

............此处省略21个文件信息

评论

共有 条评论