I would like to have a DLL with window creation and management code in such a way that the developer could just add the named.hh header and load the DLL to be able to instantiate the window.
#include "dllheader.h"
void user_main();
main = user_main;
int user_main() {
Window *w = new Window();
}
on the dll side the code should look like
void (*main)() = NULL;
int WinMain(...) {
if(main)
main();
while(!done) {
if(messageWaiting()) {
processMessage();
}
}
}
Why? because I want to expand the window wrapper and avoid the user typing the WinMain entry point. But the DLL project has the main DLL and the win32 project, which uses the DLL complaint if the linker does not find the winMain entry point.
Is there a known solution for this kind of arrangement?
source
share