jzhang0502
October 11th, 2004, 01:21 PM
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.
Exit
October 11th, 2004, 01:56 PM
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.
jzhang0502
October 11th, 2004, 04:18 PM
Thank you very much.
genossa
October 15th, 2004, 07:02 AM
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.