目的:
图片处理线程中,每得到一张图片,图片总数++;
当前结果为NG,错误图片总数++;
思路:
利用win32 API函数SetDlgItemText修改文本框内容。
ON_MESSAGE(WM_ALLCH1,OnFunc1). . .
LRESULT CMyDlg::OnFunc1(WPARAM wParam,LPARAM lParam) {}
/
AfxGetMainWnd()得到的是当前线程的主窗口(如果有的话),因为主窗口是属于主线程的,所以想得到主窗口HWND值,
只能在主线程中用AfxGetMainWnd(),但要不是处在主线程中,AfxGetMainWnd()是从当前线程查询主窗口的。但好像
AfxGetMainWnd()不能跨线程,要想在线程中使用主窗口的HWND值,可以把主窗口的HWND值传给线程.也
可以用AfxGetApp()先取得主线程,再通过CWinThread的类成员m_pMainWnd获得主窗口(AfxGetApp()->m_pMainWnd->m_hWnd)
If AfxGetMainWnd is called from the application's primary thread, it returns the application'smain window according to the above rules.
If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that
made the call.