线程锁
//锁内存
EnterCriticalSection(&gCriticalSection);
CORE("更新角色成功: ",str_clause);
//解锁
LeaveCriticalSection(&gCriticalSection);
CRITICAL_SECTION gCriticalSection;
InitializeCriticalSection(&gCriticalSection);
DeleteCriticalSection(&gCriticalSection);
CWinThread* pThreadStartRoleThread=NULL
pThreadStartRoleThread[i]=AfxBeginThread(ClearCopyRoleMT,info);
UINT ClearCopyRoleMT(LPVOID pParam)//加角色后缀名这一步
{
if(pParam==NULL)
AfxEndThread(NULL);
ClearCopy_info* pinfo;
pinfo=(ClearCopy_info*)pParam;
}
线程锁end
GetModuleFileName(NULL,szdir,MAX_PATH); //获取程序的绝对路径
PathFileExists(1.txt); //判断此文件是否存在
//注意顺序,检测内存泄露
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
//放在程序入口处
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );