Put WinMain in DLL which then calls MyMain() in exe project
Let's say I have an executable and a DLL. The executable uses the DLL. What I'm trying to achieve is to encapsulate the WinMain Method, like this:
Note, I want the WinMain to be inside the DLL, but the "void Main()" to be inside the executable. The WinMain (inside the DLL) then calls the Main method inside the exe project.
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
// Do some other code here before Main()
Simply to encapsulate it and execute additional code. I know this can be done. SDL does this, but reading its code is like reading the description of Chinese noodle soup, seriously :D
This is a VERY minimal code example, which demonstrates my attempt. It is not compile-able and I'm hoping that someone can tell me what I'm doing wrong.