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.
Printable View
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.
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.
Thank you very much.
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.