CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    23

    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.

  2. #2
    Join Date
    Jul 2002
    Location
    Denmark
    Posts
    24

    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.

  3. #3
    Join Date
    Oct 2004
    Posts
    23

    Re: what is a handle?

    Thank you very much.

  4. #4
    Join Date
    May 2004
    Location
    Simpheropol, Ukraine
    Posts
    73

    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
  •  





Click Here to Expand Forum to Full Width

Featured