diff --git a/samples/webview/cef_process_helper.cpp b/samples/webview/cef_process_helper.cpp index f30255f98b..221c5afa9e 100644 --- a/samples/webview/cef_process_helper.cpp +++ b/samples/webview/cef_process_helper.cpp @@ -1,19 +1,51 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: samples/webview_chromium/mac/process_helper_mac.cpp -// Purpose: webview_chromium launch helper +// Name: samples/webview/cef_process_helper.cpp +// Purpose: Simplest possible CEF helper. // Author: Haojian Wu // Created: 2014-06-22 -// Copyright: (c) 2014 - 2015 wxWidgets development team +// Copyright: (c) 2014 - 2023 wxWidgets development team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// This application doesn't use wxWidgets at all but does require CEF and its +// wrapper DLL. +// +// To build it using MSVC under MSW use +// +// > cl /Fewebview_cef_helper /MD /DNDEBUG /EHsc /I../../3rdparty/cef cef_process_helper.cpp ../../3rdparty/cef/Release/libcef.lib ../../3rdparty/cef/Release/libcef_dll_wrapper.lib +// +// in release mode and +// +// > cl /Fewebview_cef_helper /MDd /D_DEBUG /EHsc /I../../3rdparty/cef cef_process_helper.cpp ../../3rdparty/cef/Debug/libcef.lib ../../3rdparty/cef/Debug/libcef_dll_wrapper.lib +// +// in debug. +// +// Under Unix use +// +// $ c++ -o webview_cef_helper -I../../3rdparty/cef cef_process_helper.cpp -L../../3rdparty/cef/Release -lcef -L../../3rdparty/cef/libcef_dll_wrapper -lcef_dll_wrapper +// +// and under macOS see the commands executed by the sample makefile. + #include "include/cef_app.h" -#include "include/cef_version.h" -// Process entry point. -int main(int argc, char* argv[]) { - CefMainArgs main_args(argc, argv); +// Define simplest possible process entry point just forwarding to CEF. +#if defined(_WIN32) - // Execute the secondary process. - return CefExecuteProcess(main_args, nullptr, nullptr); +extern "C" int WINAPI +WinMain(HINSTANCE hInstance, HINSTANCE, char*, int) +{ + CefMainArgs cefArgs(hInstance); + + return CefExecuteProcess(cefArgs, nullptr, nullptr); } + +#else // !Windows + +int main(int argc, char* argv[]) +{ + CefMainArgs cefArgs(argc, argv); + + return CefExecuteProcess(cefArgs, nullptr, nullptr); +} + +#endif // Windows/!Windows