Calling WINAPI WinMain2 from Main()

Good Evening,

I was tasked with opening an auxiliary window from a C++ application. The C++ application opens the original window through OpenGL and I would like to open an additional window using something like this:
http://winapi.foosyerdoos.org.uk/code/usercntrls/htm/simplewnd.php

The original application's main entry point is through main(..){}
From within which I would like to call this function
int WINAPI WinMain2(HINSTANCE hInst,HINSTANCE,LPSTR pStr,int nCmd)

However, how would I initialize or retrieve the variables, hInst, etc. required to create this window?

I need the two windows to be able to exchange data, variables, etc.

Is there a suggested way of doing this?

Thank you,
-D
The program entry point is dependent on the application type, which is set in the linker settings (somewhere).

If it's set as a Console app, the entry point is main(); if it's set as Windows app, the entry point is WinMain().

In each case the appropriate args are passed in correctly.

That said, for a console app, you can still get the WinMain args; GetModuleHandle(NULL), GetCommandLine, I can't remember the Show command right now.
Topic archived. No new replies allowed.