使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 4905e2e7537d507f218e8e9595485e09d9f3a2b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "StdAfx.h"
#include "Cef3RunEngine.h"
 
 
CCef3RunEngine::CCef3RunEngine(void):cef_ctx_(new browser::CCef3MainContextImpl(true))
{
    ::OleInitialize(NULL);
}
 
 
CCef3RunEngine::~CCef3RunEngine(void)
{
    ::OleUninitialize();
}
 
 
BOOL CCef3RunEngine::Initialize(SApplication *app,HINSTANCE hInstance)
    InitializeCef(app,hInstance); 
 
     
    return TRUE;
}
 
void CCef3RunEngine::Release()
{
    cef_ctx_->Shutdown();
    cef_ctx_.reset();    
}
 
 
void CCef3RunEngine::InitializeCef(SApplication *app,HINSTANCE hInstance) 
{
    /*IMsgLoopFactory *pMsgLoopFactory = new SMsgLoopFactory;
    app->SetMsgLoopFactory(pMsgLoopFactory);
    pMsgLoopFactory->Release();*/
 
    CefMainArgs main_args(hInstance);
    CefRefPtr<CefApp> cef = browser::CCef3MainContext::InitCef3(main_args, NULL);
    assert(cef.get() != NULL);
        
    cef_ctx_->Initialize(main_args, cef, NULL);
}