RE: [AD] Magic main in Windows |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: <alleg-developers@xxxxxxxxxx>
- Subject: RE: [AD] Magic main in Windows
- From: "Robert Ohannessian" <ROhannessian@xxxxxxxxxx>
- Date: Sun, 1 Aug 2004 13:52:18 -0700
- Thread-index: AcR4BLJrX4s1ehTbRQymWYzxNxVaMAABJIqQ
- Thread-topic: [AD] Magic main in Windows
> 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.