RE: [AD] Magic main in Windows

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


 
> personally i use:
> 
> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR
> lpCmdLine, int nCmdShow)
> 
> instead of   int main(int argc, char *argv[])
> 
> as i need a copy of the hInstance,  maybe allegro needed it at some
point.


You can always use GetModuleHandle():

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc
/base/dllmain.asp

The instance is always the same as the module, since there is only one
instance of each module in each process.






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/