ManuelSchneid3r
ManuelSchneid3r

Reputation: 16121

How to pass a windows handle correctly?

I have no clue what's behind a handle and if its a big object or not. Generally I pass them a lot in my application, hence it would be kind if you could tell me how I should pass them. By value, const reference or even pointer?

Edit: I should mention that I talk about bitmap handles. Maybe that makes a difference.

Okay MSDN has its own page only for the uppercase windows types.

Upvotes: 4

Views: 1913

Answers (1)

David Heffernan
David Heffernan

Reputation: 613572

You can view a bitmap handle, an HBITMAP, as an ID. So, pass them around by value. They are pointer sized so there's no performance issues with pass by value for an HBITMAP.

Upvotes: 2

Related Questions