Click here to Skip to main content
16,006,594 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalaccessing database Pin
_ra2-Aug-02 3:12
_ra2-Aug-02 3:12 
GeneralRe: accessing database Pin
[James Pullicino]2-Aug-02 5:10
[James Pullicino]2-Aug-02 5:10 
GeneralRe: Soket or ASP Pin
Masaaki Onishi2-Aug-02 6:38
Masaaki Onishi2-Aug-02 6:38 
GeneralRe: Soket or ASP Pin
Anonymous3-Aug-02 5:08
Anonymous3-Aug-02 5:08 
GeneralLatitude & Longitude Pin
Daniel Ferguson2-Aug-02 2:48
Daniel Ferguson2-Aug-02 2:48 
GeneralRe: Latitude & Longitude Pin
tjkrz2-Aug-02 3:02
tjkrz2-Aug-02 3:02 
GeneralRe: Latitude & Longitude Pin
Daniel Ferguson2-Aug-02 3:38
Daniel Ferguson2-Aug-02 3:38 
GeneralReleasing allocated DC memories !!! Pin
Hadi Rezaee2-Aug-02 1:58
Hadi Rezaee2-Aug-02 1:58 
Hi there,
I have a strange problem in my program about releasing allocated DC memory !!!

struct Container
{
CBitmap* bmp_ShapeMask;
CBitmap* bmp_DegreeMask;
CDC* dc_Shape;
CDC* dc_Degree;
.
.
.

Container()
{
bmp_ShapeMask = new CBitmap;
bmp_DegreeMask = new CBitmap;
dc_Shape = new CDC;
dc_Degree = new CDC;
}

};

ok, then i loaded images and also i allocated memory for dc_Shape and dc_Degree:

m_Con.dc_Shape->CreateCompatibleDC(.........);
m_Con.dc_Degree->CreateCompatibleDC(.........);

m_Con.bmp_ShapeMask.LoadBitmap(......);
m_Con.bmp_DegreeMask.LoadBitmap(......);


and in one of my program part, i want to release all of the allocated memories ...

i wrote:

m_Con.dc_Shape->DeleteDC();
m_Con.dc_Degree->DeleteDC();

m_Con.bmp_ShapeMask.DeleteObject();
m_Con.bmp_DegreeMask.DeleteObject();

delete m_Con.dc_Shape;
delete m_Con.dc_Degree;

delete m_Con.bmp_ShapeMask;
delete m_Con.bmp_DegreeMask;


But when i got report from system memory, i saw that my program doesn't release the memory

What's the problem ???????

Please help me !!!!!



My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html

Hadi Rezaie
GeneralRe: Releasing allocated DC memories !!! Pin
Jason Henderson2-Aug-02 3:48
Jason Henderson2-Aug-02 3:48 
GeneralRe: Releasing allocated DC memories !!! Pin
Tomasz Sowinski2-Aug-02 4:01
Tomasz Sowinski2-Aug-02 4:01 
GeneralRe: Releasing allocated DC memories !!! Pin
Hadi Rezaee3-Aug-02 6:27
Hadi Rezaee3-Aug-02 6:27 
GeneralOOP-problem Pin
Mr. T2-Aug-02 1:28
Mr. T2-Aug-02 1:28 
GeneralSuggestion Pin
Ravi Bhavnani2-Aug-02 1:44
professionalRavi Bhavnani2-Aug-02 1:44 
GeneralRe: OOP-problem Pin
Raphael Kindt2-Aug-02 4:41
Raphael Kindt2-Aug-02 4:41 
GeneralReading text file Pin
hongheo762-Aug-02 1:12
hongheo762-Aug-02 1:12 
GeneralRe: Reading text file Pin
Tomasz Sowinski2-Aug-02 1:23
Tomasz Sowinski2-Aug-02 1:23 
QuestionHow to force a thread to end?? Pin
Olli2-Aug-02 0:42
Olli2-Aug-02 0:42 
AnswerRe: How to force a thread to end?? Pin
Tomasz Sowinski2-Aug-02 0:46
Tomasz Sowinski2-Aug-02 0:46 
GeneralRe: How to force a thread to end?? Pin
Olli2-Aug-02 3:05
Olli2-Aug-02 3:05 
AnswerRe: How to force a thread to end?? Pin
Navin2-Aug-02 3:08
Navin2-Aug-02 3:08 
GeneralRe: How to force a thread to end?? Pin
Olli2-Aug-02 3:16
Olli2-Aug-02 3:16 
GeneralRe: How to force a thread to end?? Pin
Daniel Lohmann2-Aug-02 3:53
Daniel Lohmann2-Aug-02 3:53 
GeneralRe: How to force a thread to end?? Pin
Todd Smith2-Aug-02 4:48
Todd Smith2-Aug-02 4:48 
GeneralRe: How to force a thread to end?? Pin
Navin2-Aug-02 4:53
Navin2-Aug-02 4:53 
AnswerRe: How to force a thread to end?? Pin
Joao Vaz2-Aug-02 5:19
Joao Vaz2-Aug-02 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.