Im using Visual Studio 2010, work with MFC 2008/2010. I have a problem with THREAD and UPDATEDATA(FALSE) This is init function
BOOL CBkav_btap2_appDlg::OnInitDialog(){
....
AfxBeginThread (MyThreadProc,(LPVOID)GetSafeHwnd());
return TRUE; // return TRUE unless you set the focus to a control
}
This is my THREAD
UINT __cdecl MyThreadProc( LPVOID pParam )
{
DWORD totalphys;
DWORD availablephys;
DWORD memoload;
CBT2Class* pObject = (CBT2Class*)pParam;
pObject->GetRAMandCPUInfo(totalphys,availablephys,memoload );
CBkav_btap2_appDlg dlgObject;
dlgObject.ec_totalphys = totalphys;
dlgObject.UpdateData(FALSE);<--- Can not update data
return 0;
}
CBT2Class is the class in dll file i created before. ec_totalphys is just an edit_control. When i run, it return "Debud Assertion failed". I dont know why. Please help me. Thankss. p/s: I think i need use SendMessage to update data for Dialog but i search every where but still can't work.
dlgObject
. It appears you want to update the dialog that started this thread in the first place. – WhozCraig