C++使用DUILIB库开发嵌入浏览器方法

Home / C++ MrLee 2015-6-10 7263

分析QQ的框框,你会发现,字体等格式编辑其实都是网页。


1.xml配置

2.加载控件
void CMailDialog::Init() {
       
         SetIcon(IDR_MAINFRAME); //   Set   big   icon
         
        
         m_pCloseBtn = static_cast(paint_manager_.FindControl(_T("closebtn")));
         
         CActiveXUI* pActiveXUI = static_cast(paint_manager_.FindControl(_T("ie")));
        if( pActiveXUI ) {
            IWebBrowser2* pWebBrowser = NULL;
            pActiveXUI->GetControl(IID_IWebBrowser2, (void**)&pWebBrowser);
            if( pWebBrowser != NULL ) {
                std::string strPath=ConfigManager::instance()->getSkinPath()+"MailEditorindex.html";
 
                int Len=::MultiByteToWideChar (CP_ACP, 0, strPath.c_str(), -1, NULL, 0);
                wchar_t *buf=new wchar_t [Len];
                MultiByteToWideChar(CP_ACP,0,strPath.c_str(),-1,buf,Len);
                std::wstring wstrFilePath=std::wstring(buf);
                delete[] buf;
 
                pWebBrowser->Navigate((BSTR)(wstrFilePath.c_str()),NULL,NULL,NULL,NULL); 
                pWebBrowser->Release();
            }
        }
          
    }
index.html




邮件编辑器








本文链接:https://www.it72.com/3336.htm

推荐阅读
最新回复 (0)
返回