void CUIPopupWnd::ieThreadProc(MSG* msg, LPVOID lpParameter){
CUIPopupWnd *ptrPopUpWndCtrl = (CUIPopupWnd*)GetWindowLongPtr((HWND)msg->wParam , GWLP_USERDATA);
switch(msg->message)
{
case WM_IECREATE:
{
REPORT_INTERNAL_SW_ERROR_EXT(L"HTML frame is going to be created.");
ptrPopUpWndCtrl->m_htmlAttributes.pBrowser = new (nothrow)CUIHTMLFrameWnd((HWND)msg->wParam,ptrPopUpWndCtrl->m_ulPresentWidth,ptrPopUpWndCtrl->m_ulPresentHeight);
if( NULL == ptrPopUpWndCtrl->m_htmlAttributes.pBrowser )
{
REPORT_INTERNAL_SW_ERROR_EXT(L"EmbeddedBrowser failed");
}
else
{
//m_htmlAttributes.pBrowser->createControl(this->m_hWnd,this->m_ulPresentWidth,this->m_ulPresentHeight);
ptrPopUpWndCtrl->m_htmlAttributes.pBrowser->m_currentURL = ptrPopUpWndCtrl->m_htmlAttributes.m_szHTMLPath;
ptrPopUpWndCtrl->m_htmlAttributes.pBrowser->RepaintBrowser();
ptrPopUpWndCtrl->m_htmlWindowsList.push_front(ptrPopUpWndCtrl);
ptrPopUpWndCtrl->m_htmlAttributes.pBrowser->Navigate(ptrPopUpWndCtrl->m_htmlAttributes.pBrowser->m_currentURL);
}
}
break;
case WM_IEREFRESH:
{
ptrPopUpWndCtrl->m_htmlAttributes.pBrowser->Navigate(ptrPopUpWndCtrl->m_htmlAttributes.pBrowser->m_currentURL);
ptrPopUpWndCtrl->m_htmlAttributes.m_fReloadRequired = false;
}
break;
default:
return;
}
CThreadController::getThreadController().createUIThread( ieThreadProc, IEThread,NULL );
CThreadController::getThreadController().postThreadMessage(IEThread,WM_IECREATE,(_wparam)this->m_hWnd,0);
CThreadController::getThreadController().postThreadMessage(IEThread,WM_IEREFRESH,(_wparam)this->m_hWnd,0);
ここで、ieThreadProcは静的スレッドプロシージャです。このIWebBrowser2 comコントロールの親であると思われるWin32ウィンドウ(this-> m_hWnd)があります。クロススレッドの問題のため、IEコントロールがあるスレッドにメッセージを投稿します。作成し、それを使用します。デバッグ中は、破損は表示されません。ただし、IEコントロールは単に空白を表示し、ページは表示されません。親切に解決策を手伝ってください。