xxx.cpp에 Thread를 생성한다.

 

// Thread Create.
HANDLE m_thread_cmd = NULL;
ULONG __stdcall autorun_Cmd_Execute(LPVOID pParam);

 

// thread를 생성하거나 실행시키는 부분.

// Command Line Run & exit.
if(m_thread_cmd ==NULL) m_thread_cmd =CreateThread(0,0, autorun_Cmd_Execute, this, 0,0);
else{ ::TerminateThread(m_thread_cmd ,0); m_thread_cmd =CreateThread(0,0, autorun_Cmd_Execute, this, 0,0); }

 

 

//////////////////////////////////////////////////////////////////////////
// Create :
// Update :
// Function : autorun_Cmd_Execute
// parameter: LPVOID pParam
// return : true, false
// review : the create Thread and then execute.
//////////////////////////////////////////////////////////////////////////
ULONG __stdcall autorun_Cmd_Execute(LPVOID pParam)

{

// 부모 핸들을 가져온다.

CTSDEV_BuilerDlg* pDlg=(CTSDEV_BuilerDlg*)pParam; //추가
if (pDlg == NULL || !pDlg->IsKindOf(RUNTIME_CLASS(CTSDEV_BuilerDlg))) return false;

}

 

+ Recent posts