Xplatcppwindowsdll Updated !!top!! Now
While the xplatcppwindowsdll updated version is superior, early adopters have reported three specific issues:
Passing complex STL containers (like std::string or std::vector ) across the DLL boundary.
Overwriting fails with a "file in use" error. The cross-platform updater must detect Windows and trigger a different routine: download Filter_v2.dll , instruct the application (via IPC) to enter "update mode" (drain existing image processing jobs), call FreeLibrary , copy Filter_v2.dll to Filter.dll , call LoadLibrary , and resume. The abstraction layer presents the same update_plugin(const char* path) API to the rest of the code, hiding the OS-specific mechanics. xplatcppwindowsdll updated
The xplatcppwindowsdll update has already been tested in three production environments.
The most recent updates focus on the core logic from the Windows operating system: The update introduces a cleaner macro: Clean your
#ifdef _WIN32 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (fdwReason == DLL_PROCESS_DETACH && !Engine::instance().isShutdown()) OutputDebugString(L"Warning: xplatcpp DLL unloaded without calling shutdown()");
The tedious __declspec(dllexport) dance has been modernized. The update introduces a cleaner macro: For C++ desktop apps
Clean your build directory and re-configure:
While Windows lacks fork() , a similar effect is achieved using a "launcher" process. The main application requests an update, spawns a new instance of itself that loads the new DLL, passes the communication handle (e.g., socket or named pipe), and then gracefully terminates. This is common in web servers (e.g., Nginx’s binary upgrade). For C++ desktop apps, this ensures zero downtime for the user session, though the underlying process changes.