Thread: clearing resources

  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,793
    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, 05: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-14-2004, 11:28 PM
  4. Adding resources
    By nima_ranjbar in forum Windows Programming
    Replies: 0
    Last Post: 04-14-2002, 11:36 PM
  5. Dialogs and resources
    By SushiFugu in forum Windows Programming
    Replies: 6
    Last Post: 01-23-2002, 02:05 PM