Hello,
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.Code:int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // Do some other code here before Main() Main(); return 0; }
Why?
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
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.
http://dev-ch.com/files/5629e88b-874...mymaintest.zip
Greetings