daktor says:
Another solution is to add code to the entry point of your application (eg WinMain) to handle when CEF is creating a sub-process. Searching the command line for "--type=" works but there may be better ways to detect that CEF should handle things. Once you know it's CEF, return CefExecuteProcess(...) and exit instead of proceeding into your application.
This fixes the problem without adding an additional executable to your project.
INT WINAPI WinMain( HINSTANCE hInInstance, HINSTANCE hPrevInstance, char*, INT nCmdShow )
{
...
}
INT WINAPI WinMain( HINSTANCE hInInstance, HINSTANCE hPrevInstance, char*, INT nCmdShow )
{
if (GetCommandLine().HasStr("--type=="))
{
CefExecuteProcess(..);
}
else
{
// continue as usual
}
}
daktor wrote:In that function (or whatever your app's entry function is), you can parse the command line for "--type=". Using that information, if you determine that it is cef that is trying to launch a process, instead of continuing with your WinMain(..) function, immediately return CefExecuteProcess(..).
int exit_code = CefExecuteProcess(main_args, cefApplication.get());
if (exit_code >= 0) {
//The sub-process terminated, exit now.
return exit_code;
}
const char *path= "C:/Project/Webkit/applicationTest/SubProcApp/SubProc/Debug/SubProc";
CefString(&appSettings.browser_subprocess_path).FromASCII(path);
My question is how will this stop the main application spawning issue.
Users browsing this forum: Devyre and 85 guests