#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include "include/cef_app.h"
#include "include/cef_base.h"
#include "cefapplicationhandler.h"
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
CefMainArgs main_args(hInstance);
CefRefPtr<cefapplicationhandler> app(new cefapplicationhandler);
return CefExecuteProcess(main_args, app.get());
}
#include "include/cef_app.h"
class cefapplicationhandler : public CefApp,
public CefBrowserProcessHandler,
public CefRenderProcessHandler
{
public:
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler()
OVERRIDE { return this; }
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler()
OVERRIDE { return this; }
virtual bool OnProcessMessageReceived(
CefRefPtr<CefBrowser> browser,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message) OVERRIDE
{
if (message->GetName() == "InvokeScript")
{
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
frame->ExecuteJavaScript("alert('ExecuteJavaScript works!');",frame->GetURL(), 0);
return true;
}
}
IMPLEMENT_REFCOUNTING(cefapplicationhandler);
};
giridharb54 wrote:the subproc.exe is crashing. Also on loading few sites rich in html5 my subproc.exe is crashing.
You can use a release build of libcef with the debug build of your application to avoid debug assertions.
giridharb54 wrote:Are you suggesting me to use release build libcef_dll_wrapper.lib with debug build of my application. wont it throw linker errors if I do this way?? When you say use release build of libcef what do you mean???
Users browsing this forum: No registered users and 139 guests