|
-
October 11th, 2004, 01:21 PM
#1
what is a handle?
And what is the difference of handle in a pointer.
Sorry for asking such a stupid question, but I am really new to the windows
c++ program.
-
October 11th, 2004, 01:56 PM
#2
Re: what is a handle?
A handle is index used internally by Windows to identify the particular instance of any of an number of different types of objects. Some people think of it as a kind of pointer, but really that is incorrect. You can do arithmetic with pointers, you should not do so with handles. In most cases a handle is a 32bit integer.
Don't worry about handles, you rarely manipulate them. Some API routines require them to identify an object, other routines return them. Normally all you do with handles is get them, store them and pass them.
Pointers can be used for all manner of things. You can, for example, use the increment operator on a pointer, and assuming you've got your data structures right, get a meaningful result, not the case with a handle.
-
October 11th, 2004, 04:18 PM
#3
-
October 15th, 2004, 07:02 AM
#4
Re: what is a handle?
Hi, jzhang0502!
To be more exact, handle is an index of the kernel object in the pocess's kernel object handle table. In Win2000 handle identifies the number of bytes into the process's handle table for the object rather than the index number itself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|