Would this be legal? (HINSTANCE)

Started by
4 comments, last by Utwo 20 years, 11 months ago
Would it be legal to pass an HINSTANCE, and more specifically, the application''s HINSTANCE to a another function by value? I mean, of course it would compile but would the recieving function then have a handle to the application''s instance, or just some copy of an HINSTANCE that it can''t use?
---signature---" Actually, at the time, I didn't give a damn about the FoxNews issue... just that you would come swooping in with your Super Mith cape flapping behind you and debunk it just because it didn't happen in your living room." - InnocuousFox
Advertisement
an H is a pointer, so it shouldnt matter.
Not always.
Yes, it is legal. Think of all the times you have to pass a handle of some sort into Windows...
This is how WinMain defined:
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPCTSTR, int );

and HINSTANCE is passed by value.
Yes. You can pass a pointer by value too though. You just wouldn''t get the result you wanted.
---signature---" Actually, at the time, I didn't give a damn about the FoxNews issue... just that you would come swooping in with your Super Mith cape flapping behind you and debunk it just because it didn't happen in your living room." - InnocuousFox

This topic is closed to new replies.

Advertisement