Archived

This topic is now archived and is closed to further replies.

mfc , when it will die ????

This topic is 5577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi got a problem i''ve written a program that loads a file, tga, gif, pcx, bmp , i then convert it into a bitmap file to be displayed under an mdi child window , when i close the window i release the memory involved, using the deleteobject(m_bitmap) function, the function returns true, but when i debug i still get an huge amount of memory leaks, after studying ( a lot ) the code, i''ve found that the deleteobject function although returns true ,doesn''t release the memory of the bitmap itself, now i''m asking how can it be ? how can i remove these memory leaks ? and most of all , when mfc will die ( for ever ? ) thanks in advance

Share this post


Link to post
Share on other sites
Why don''t you just make the bitmap a member variable of the MDI child window? That way when the child window gets destroyed, so does the bitmap [period]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How can you say that MFC and DOS are dead?

Lots of people are using both still...I think that was more of a "slam" towards MFC then being any help.

Just remember just cause YOU don''t understand MFC doesn''t mean everyone else has to hate it as well!

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
How can you say that MFC and DOS are dead?

Lots of people are using both still

Yeah, lots of people are using DOS still. Only difference is, they are calling it Windows 95 and Windows 98 now.



When I look upon seamen, men of physical science, and philosophers, man is the wisest of all beings. When I look upon priests, prophets, and interpreters of dreams, nothing is so contemptible as man.


  Diogenes

Share this post


Link to post
Share on other sites
quote:
Original post by VolkerG
and what alternatvies do we have? .NET framework (in my opinion a pain for C++), WTL (doesn''t seem to be supported officially my MS)


WTL is far superior to MFC. Supported or not.

Share this post


Link to post
Share on other sites
quote:
Original post by v71
when mfc will die ( for ever ? )


When there are no more books published on MFC.

and regarding the memory leak, before DeleteObject(yourbmpobj), try SelectObject(defaultObj) so that no body is referencing the beautiful yourbmpobj.

Share this post


Link to post
Share on other sites