If AfxGetMainWnd is called from the application's primary thread, it returns the application's main 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.
work线程别用AfxGetMainWnd,AfxGetApp->m_pMainWnd->SendMessage(),或者其他方法