Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Data type HANDLE

Data type HANDLE

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hello, I'm curious about what date type is a HANDLE? Is it an int pointer? Thanks.

    S T J 3 Replies Last reply
    0
    • A Anonymous

      Hello, I'm curious about what date type is a HANDLE? Is it an int pointer? Thanks.

      S Offline
      S Offline
      Simon W 0
      wrote on last edited by
      #2

      Not exactly a pointer,it just a handle,you can take some operation on it or with it I am seeking... For what? Why did you ask me for what? I don't know!

      1 Reply Last reply
      0
      • A Anonymous

        Hello, I'm curious about what date type is a HANDLE? Is it an int pointer? Thanks.

        T Offline
        T Offline
        Toco
        wrote on last edited by
        #3

        Hello , As I know from Inside Win2k, when a process creates or opens an object(object is almost everything in Windows ) by name, it receives a handle that represents its access to the object. This is like a secure pointer taken from OS. **Object is symbolic link, process, thread, job, section, event, semaphore and ...

        A 1 Reply Last reply
        0
        • T Toco

          Hello , As I know from Inside Win2k, when a process creates or opens an object(object is almost everything in Windows ) by name, it receives a handle that represents its access to the object. This is like a secure pointer taken from OS. **Object is symbolic link, process, thread, job, section, event, semaphore and ...

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.

          M G T 3 Replies Last reply
          0
          • A Anonymous

            I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.

            M Offline
            M Offline
            Maximilien
            wrote on last edited by
            #5

            me think a HANDLE is the same size as a pointer; so 32 bits. look into winnt.h


            Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

            1 Reply Last reply
            0
            • A Anonymous

              I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.

              G Offline
              G Offline
              Graham Bradshaw
              wrote on last edited by
              #6

              How about sizeof(HANDLE) ?

              1 Reply Last reply
              0
              • A Anonymous

                Hello, I'm curious about what date type is a HANDLE? Is it an int pointer? Thanks.

                J Offline
                J Offline
                JWood
                wrote on last edited by
                #7

                HANDLE is unsigned long (DWORD). It is like a pointer because it is unique, but it is hashed to some pointed in memory. Windows manages the memory and this can be shifted and moved around to prevent memory fragmentation, but the HANDLE remains the same. J. ----------------------------

                1 Reply Last reply
                0
                • A Anonymous

                  I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.

                  T Offline
                  T Offline
                  Toco
                  wrote on last edited by
                  #8

                  I think this will give you clear answer ! typedef void *PVOID; .... #ifdef STRICT typedef void *HANDLE; #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name #else typedef PVOID HANDLE; #define DECLARE_HANDLE(name) typedef HANDLE name #endif typedef HANDLE *PHANDLE; ** This is taken from WinNT.h

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups