What is a handle exactly?

This is a discussion on What is a handle exactly? within the C Programming forums, part of the General Programming Boards category; thanks...

  1. #1
    corey-
    Guest

    What is a handle exactly?

    thanks

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    It generally means an "indirect access" pointer, but sometimes it's direct. For instance, in Windows, we get a handle to a bitmap with CreateCompatibleBitmap(). But the pointer it returns does not give you direct access to the bitmap bits. Thus, this is a "true" handle. On the other hand, you could assign a pointer to an int, but that would be a "direct" handle since you can physically manipulate the value at the other end of it...
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    corey-
    Guest
    thank you =)

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    yes, summed up, it's just a way to reference an object (usually a data structure in memory).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with setting text into LTEXT using Window Handle
    By jasperleeabc in forum Windows Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Getting other processes class names
    By Hawkin in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2008, 04:02 PM
  3. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21