clearing resources

This is a discussion on clearing resources within the Windows Programming forums, part of the Platform Specific Boards category; Hi, if I have a structure with an HBITMAP in it would I have to delete the HBITMAP when the ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    112

    clearing resources

    Hi, if I have a structure with an HBITMAP in it would I have to delete the HBITMAP when the program ends and if so how?

    for example if i have a structure like below:
    struct advertisment
    {
    HBITMAP banner;
    char bannerSite[150];
    };
    advertisment bannerAdd;

    would I delete the bitmap like below?
    DeleteObject(bannerAdd.banner)

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    That should do it.......but remember that freeing the resource at the end of the program is only a notional act as the system will free all resources when it destroys the process....so dont worry about your resource clogging up system memory somewhere.....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resources in Dev C++
    By JJFMJR in forum Windows Programming
    Replies: 7
    Last Post: 08-27-2007, 06:14 AM
  2. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 05:35 PM
  3. Storing resources into a single file
    By LuckY in forum Game Programming
    Replies: 20
    Last Post: 08-15-2004, 12:28 AM
  4. Adding resources
    By nima_ranjbar in forum Windows Programming
    Replies: 0
    Last Post: 04-15-2002, 12:36 AM
  5. Dialogs and resources
    By SushiFugu in forum Windows Programming
    Replies: 6
    Last Post: 01-23-2002, 02:05 PM

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