S
Shraddha
What is exactly a handle to an object????Is it same as reference....
Handle is NOT a C++ term. In windows a HANDLE is an opaque datatypeShraddha said:What is exactly a handle to an object????Is it same as reference....
What is exactly a handle to an object????Is it same as reference....
Handle is NOT a C++ term.
In windows a HANDLE is an opaque datatype
that really was a pointer at some point (perhaps in the operating
systems address space) that you're not supposed to treat as a pointer
just an indentifier of some system created resource.
Think of it as a void*
you can't do anything with other than pass
back to other functions in the API.
On 2007-06-10 06:20:01 -0700, Shraddha <[email protected]> said:
The term "handle" is meaningless as far as C++ is concerned. Different
platforms and environments use the term for different concepts.
Roland said:Sort of. A handle typically encapsulates access to resources and/or
objects.
It is a term of any language, including C++, that uses handles.
Great idea, isn't it?
A handle (and also a HANDLE) usually isn't a void*.
... which is exactly what you want when you use a handle.
BTW, Stroustrup sometimes uses 'handle' synonymously with 'smart
pointer' which is, IMO, misleading ('smart pointers' don't encapsulate
the pointed-to objects).
The concept is well known in computer science in general. It's
an opaque identifier of something.
(Handles existed way before Windows.)
Shraddha said:What is exactly a handle to an object?
Is it same as reference?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.