Попробуйте использовать CEF из C ++. Сделать простой проект:
#include <Windows.h>
#include <include/cef_app.h>
#include <include/cef_client.h>
#include <include/wrapper/cef_helpers.h>
class Handler : public CefClient {
public:
private:
IMPLEMENT_REFCOUNTING(Handler);
};
class App : public CefApp, public CefBrowserProcessHandler {
public:
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override {
return this;
}
void OnContextInitialized() override {
CEF_REQUIRE_UI_THREAD();
CefRefPtr<Handler> handler(new Handler);
CefWindowInfo wndInfo;
wndInfo.SetAsPopup(0, "Hello world");
CefBrowserSettings settings;
std::string url{ "https://stackoverflow.com" };
CefBrowserHost::CreateBrowser(wndInfo, handler, url, settings, nullptr, nullptr);
}
private:
IMPLEMENT_REFCOUNTING(App);
};
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {
CefEnableHighDPISupport();
CefMainArgs args(hInstance);
int ec = CefExecuteProcess(args, nullptr, nullptr);
if (ec >= 0) {
return ec;
}
CefSettings settings;
CefRefPtr<App> app(new App);
CefInitialize(args, settings, app, nullptr);
CefRunMessageLoop();
CefShutdown();
return 0;
}
Папка проекта содержит все файлы из cefclient (официальный пример cef)
08.04.2020 12:21 2 133 001 cef.pak
08.04.2020 12:21 654 037 cef_100_percent.pak
08.04.2020 12:21 808 292 cef_200_percent.pak
08.04.2020 12:21 1 772 827 cef_extensions.pak
08.04.2020 12:21 1 110 016 chrome_elf.dll
08.04.2020 12:21 4 346 120 d3dcompiler_47.dll
08.04.2020 12:21 7 015 266 devtools_resources.pak
08.04.2020 12:21 10 505 952 icudtl.dat
08.04.2020 12:21 158 316 032 libcef.dll
08.04.2020 12:21 391 168 libEGL.dll
08.04.2020 12:21 10 552 832 libGLESv2.dll
08.04.2020 12:44 <DIR> locales
09.04.2020 18:14 613 247 main.obj
09.04.2020 18:14 3 948 032 Project1.exe
08.04.2020 12:21 606 640 snapshot_blob.bin
08.04.2020 12:49 <DIR> swiftshader
08.04.2020 12:21 923 968 v8_context_snapshot.bin
09.04.2020 18:14 519 168 vc142.idb
09.04.2020 18:14 847 872 vc142.pdb
почему я могу получить пустую страницу?