WinApi, Alias for HINSTANCE hInstance
-
In a tutorial for WinApi i found equating a LHS to hInstance without previous declaration.
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { hInst=hInstance; ...
Is this a way to define an alias for a symbol?
-
No. Must be a mistake then.
-
I found it. The symbol hInst was declared as global variable.
Bad coding style not to use sort of identification in the variable name for a global variable. If you don't know that hInst is global you just get confused.
-
MC schrieb:
If you don't know that hInst is global you just get confused.
Or you just use your IDE and jump to the declaration/definition.
-
MC schrieb:
If you don't know that hInst is global you just get confused.
Mhm, if it compiles, global declaration is the only way it could be managed.