MFC多文档应用程序中嵌入cef3,启动时一次性启了三个多文档应用程序

新建多文档应用程序,新增了Dialog,在Dialog的OnCreate中实现 了cef的CefExecuteProcess、CefInitialize、CreateBrowser,编译无误,结果运行时一下启了多文档实例,而且网页也没有显示出来。
附代码:
int CTestDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialogEx::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO:  Add your specialized creation code here
CefMainArgs main_args ( AfxGetApp()->m_hInstance );
CefRefPtr<CCefClientApp> app (new CCefClientApp);

if (CefExecuteProcess(main_args, app.get()) == -1)
{
    CefSettings settings;
    CefSettingsTraits::init( &settings);
    settings.multi_threaded_message_loop = true;
    CefInitialize (main_args, settings, app.get());

    example_cef_handler = new CCefClient();
    CefWindowInfo info;
    RECT rect;
    GetClientRect(&rect);
    RECT rectnew=rect;
    rectnew.top=rect.top;
    rectnew.bottom=rect.bottom;
    rectnew.left=rect.left;
    rectnew.right=rect.right;
    info.SetAsChild(GetSafeHwnd(),rectnew);
    //

    CefBrowserSettings settings1;
    CefBrowserHost::CreateBrowser(info, example_cef_handler.get(), CefString ("www.baidu.com"), settings1, NULL);
}
return 0;

}

void CMainFrame::OnTestTest32772()
{
// TODO: Add your command handler code here
CTestDlg mTestDlg;
mTestDlg.DoModal();
}
求大神指教一二!图片说明

1个回答

LZ你的Demo 还有吗,我研究的也是多文档,真的是要累吐血,可还是没弄出来,方便给个Demo学习一下吗?跪谢啊!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐