Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Utwo

Would this be legal? (HINSTANCE)

This topic is 5524 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
an H is a pointer, so it shouldnt matter.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Not always.

Share this post


Link to post
Share on other sites
Yes, it is legal. Think of all the times you have to pass a handle of some sort into Windows...

Share this post


Link to post
Share on other sites
This is how WinMain defined:
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPCTSTR, int );

and HINSTANCE is passed by value.

Share this post


Link to post
Share on other sites
Yes. You can pass a pointer by value too though. You just wouldn''t get the result you wanted.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!