Click to See Complete Forum and Search --> : Brief question
I am blue
December 14th, 2004, 12:20 PM
Hi,
I am new on using Visual C++, and I have lots of doubts about windows API's.
I am trying to do some code that uses bluetooth functions provided in the service pack 2 of windows XP.
I would like to know what exactly is a HANDLE. From what I have seen, I think that a HANDLE is a sort of identifier that "points" (is a Handle something similar to a pointer?) to structures of data, but anyway, I still am not sure about what exactly a HANDLE is, so I need your help.
Thanks.
kirants
December 14th, 2004, 01:50 PM
HANDLE is a loosely defined term.. One could use the term in multiple ways..
In windows world.. it is normally used to identify kernel objects. Sort of like an ID. How it is used is upto to Windows implementation. Windows can if it wants treat it like a pointer, or an index to a table , or whatever. But generally it is used as an abstraction to the actual data...
Also, windows also uses HWNDs which are handle to windows.. These are again similar in how they are treated..
NoHero
December 14th, 2004, 01:57 PM
(is a Handle something similar to a pointer?)
No. As kirants said its just and ID to an internal memory block. So you must not delete or free it. (Just wanted to point at this)
Andreas Masur
December 14th, 2004, 03:26 PM
You might want to search the forums...this question has been asked several times...
I am blue
December 15th, 2004, 10:09 AM
Thanks for your help guys.
I looked up at FAQ's about this topic before I put the post, and I didn't find anything. Anyway, I'll look again to search for more information.
I am blue
December 15th, 2004, 01:15 PM
For anyone interested in the definition of HANDLE, I finally found on MSDN the next definition:
HANDLE:
"A value that uniquely identifies something such as a file or data structure.
Handles are meaningful only to the software that creates and uses them but are passed by other software
to identify things. ODBC defines handles for environments, connections, statements, and descriptors."
It still is quite vague, but at least is something.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.