Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Running out of system Resources

Posted on 1997-05-30
4
Medium Priority
?
538 Views
Last Modified: 2008-02-26
*/ from my .cpp file
#pragma argsused
BOOL Wintodo_OnCreate(HWND hwnd, CREATESTRUCT FAR*  lpCreateStruct)
{
      
      CreateWindow("BorBtn",NULL,
      WS_CHILD|WS_VISIBLE|WS_BORDER,
      1,0,24,20,hwnd,HMENU(801),
      hInstance,NULL);
}

 */ Segment from my resource file /*
1801 BITMAP "1801.bmp"
3801 BITMAP "3801.bmp"


My program does not call "LoadBitmap" to use these
bitmaps, they seem to have been loaded automatically
by the program the only problem is that i am running out
of system resources because my program does not seem to be freeing the resources it loaded when i comment out the bitmaps in my resource file every thing seem to be OK.
My question is Must i use LoadBitmap?? and where should i use it i tried using it before the call to CreateWindow
but it did'nt make a diffenence.
Should i call DeleteObject()?? and if so how can i if i
don't have a handle to this bitmap any where in my program which does'nt seem to need it anyway and also i cannot use an integer in the call to LoadBitmap, am i doing something wrong (I got the documentation for placing a bitmap on my buttons from Borland TechFax Document #1534).
 Thanx in aDvanCe.
0
Comment
Question by:mwebster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:mwebster
ID: 1163766
Edited text of question
0
 

Author Comment

by:mwebster
ID: 1163767
Adjusted points to 100
0
 
LVL 1

Accepted Solution

by:
ramshank earned 200 total points
ID: 1163768
If you are trying to load a bitmap on to a window it is always advisable  to use LoadBitmap function. Aftre completeting your operation DeleteObject should be used for deleteting the bitmap object. the advantage of usinfg LoadBitmap is that it gives you a  handle  to the open bitmap which can be used anywhere. For the LoadBitmap include the bitmap into your resource and use use  MAKEINTRESOURCE  in your LoadBitmap function.
0
 

Author Comment

by:mwebster
ID: 1163769
iin reply to  ramshank's answer these buttons are being used
as a short cut to my program's main menu and  not in a dialogbox
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question