FATAL:request_context_impl.cc(151)] Check failed: false. con

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

FATAL:request_context_impl.cc(151)] Check failed: false. con

Postby wersfd » Thu Dec 24, 2020 8:46 pm

Code: Select all
        ui->setupUi(this);
    this->setWindowFlags(Qt::CustomizeWindowHint|Qt::FramelessWindowHint);
        ui->verticalLayout->addWidget(new QWidget());
       HWND wnd = (HWND)ui->widget->winId();
       // HWND wnd = (HWND) this->winId();
        CefWindowInfo cefWndInfo;
        QString strUrl = "https://www.google.com";
        RECT winRect;

        QDesktopWidget *pDeskTop = QApplication::desktop();
        QRect qtRect = pDeskTop->screenGeometry();

        winRect.left = qtRect.left();
        winRect.top = qtRect.top();
        winRect.right = qtRect.right();
        winRect.bottom = qtRect.bottom();

 
        cefWndInfo.SetAsChild(wnd, winRect);

        CefBrowserSettings cefBrowSetting;
        browser_event_ = CefRefPtr<cefclient>(new cefclient(this));
        CefRefPtr<CefDictionaryValue> extra_info;
        CefRefPtr<CefRequestContext> request_context;
       // bool browser = CefBrowserHost::CreateBrowser(cefWndInfo, browser_event_, strUrl.toStdString(), cefBrowSetting, extra_info,request_context);
        request_context = CefRequestContext::GetGlobalContext();
             bool browser = CefBrowserHost::CreateBrowser(cefWndInfo, browser_event_, strUrl.toStdString(), cefBrowSetting, nullptr,request_context);

        connect(ui->btn_go, SIGNAL(clicked()), this, SLOT(on_url()));
        showMaximized();


got error in debug log:
FATAL:request_context_impl.cc(151)] Check failed: false. context not valid

and in qt debug mode error occurred here(please refer to the attachment)

cef_request_context_t* _retval = cef_request_context_get_global_context();
Attachments
Lark20201225094444.png
Lark20201225094444.png (47.31 KiB) Viewed 1529 times
wersfd
Newbie
 
Posts: 4
Joined: Mon May 04, 2020 11:41 pm

Re: FATAL:request_context_impl.cc(151)] Check failed: false.

Postby magreenblatt » Thu Dec 24, 2020 9:11 pm

Are you in the main process? Have you called CefInitialize?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 104 guests