Click here to Skip to main content
16,016,394 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblem with WM_NOTIFY from a ClistViewCtrl Pin
uo200023-Jan-02 7:29
uo200023-Jan-02 7:29 
Generalwhatif (ptr = malloc ( nSize ) ) == NULL Pin
Mike Doner23-Jan-02 6:25
Mike Doner23-Jan-02 6:25 
GeneralRe: whatif (ptr = malloc ( nSize ) ) == NULL Pin
Joaquín M López Muñoz23-Jan-02 10:24
Joaquín M López Muñoz23-Jan-02 10:24 
GeneralDouble Buffering vs. Private DC's Pin
Mark Lenz23-Jan-02 4:56
Mark Lenz23-Jan-02 4:56 
GeneralRe: Double Buffering vs. Private DC's Pin
Mark Lenz23-Jan-02 7:58
Mark Lenz23-Jan-02 7:58 
GeneralRe: Double Buffering vs. Private DC's Pin
Michael Dunn23-Jan-02 8:15
sitebuilderMichael Dunn23-Jan-02 8:15 
GeneralRe: Double Buffering vs. Private DC's Pin
Mark Lenz23-Jan-02 10:16
Mark Lenz23-Jan-02 10:16 
GeneralRe: Double Buffering vs. Private DC's Pin
Shog923-Jan-02 15:28
sitebuilderShog923-Jan-02 15:28 
As Mr. Dunn mentioned above, Windows 98 is very sensitive to resource leaks. However, you can usually detect when this is happening on Windows 2000 by using the task manager. Display the processes page, use the View->Select Columns menu to display the GDI Objects column, and watch the number for your application. If there is a constant increase while it is running, then you've detected the resource leak (this is safer than running the app in Win95/Win98, since resource leaks can cause those OSs to become unstable).

Once you can quickly identify the resource leak, modify your code by commenting out lines that create and use GDI resources, one at a time. In this way you should be able to identify which resources are not being released.

The method you're describing sounds like it should be working; however, because you're relying on automatic deletion of the objects there is no easy way to verify that it is successful. Inserting temporary DeleteObject() calls before the objects go out of scope might also be a good way to narrow down the search:
VERIFY(gdiObj.DeleteObject());
If this line ASSERT()s, then you've found a problem.

And if you can reduce your problem to a few lines of code (i.e.
<br />
CPen pen(PS_SOLID, 1, RGB(0,255,0));<br />
int nSave = dc.SaveDC();<br />
dc.SelectObject(&pen);<br />
VERIFY(dc.RestoreDC(nSave));<br />
VERIFY(pen.DeleteObject());<br />
) then post it here, & someone will prolly figure it out.


farewell goodnight last one out turn out the lights
Smashing Pumpkins, Tales of a Scorched Earth

GeneralRe: Double Buffering vs. Private DC's Pin
Michael Dunn23-Jan-02 19:24
sitebuilderMichael Dunn23-Jan-02 19:24 
GeneralRe: Double Buffering vs. Private DC's Pin
Mark Lenz23-Jan-02 11:22
Mark Lenz23-Jan-02 11:22 
GeneralCDROM Information Pin
Adrian Metcalfe23-Jan-02 4:42
Adrian Metcalfe23-Jan-02 4:42 
GeneralRe: CDROM Information Pin
moliate23-Jan-02 15:29
moliate23-Jan-02 15:29 
GeneralAFX_EXT_CLASS no assure export Pin
Franck George23-Jan-02 4:25
Franck George23-Jan-02 4:25 
GeneralRe: AFX_EXT_CLASS no assure export Pin
Joao Vaz23-Jan-02 4:43
Joao Vaz23-Jan-02 4:43 
GeneralRe: AFX_EXT_CLASS no assure export Pin
Joao Vaz23-Jan-02 4:46
Joao Vaz23-Jan-02 4:46 
GeneralRe: AFX_EXT_CLASS no assure export Pin
Member 18414215-Jul-10 0:23
Member 18414215-Jul-10 0:23 
GeneralPLEASE Help URGENT Pin
Sonu Kapoor23-Jan-02 4:11
Sonu Kapoor23-Jan-02 4:11 
GeneralVisual C++ & OpenGL Pin
Rajveer23-Jan-02 3:16
Rajveer23-Jan-02 3:16 
QuestionIs MFC thread-safe? DialogBar with DLGTEMPL? Pin
HintiFlo23-Jan-02 2:21
HintiFlo23-Jan-02 2:21 
GeneralOnInitDialog called in Release, but not in Debug! Pin
Jonnie White23-Jan-02 0:50
Jonnie White23-Jan-02 0:50 
GeneralRe: OnInitDialog called in Release, but not in Debug! Pin
Alvaro Mendez23-Jan-02 9:37
Alvaro Mendez23-Jan-02 9:37 
GeneralRe: OnInitDialog called in Release, but not in Debug! Pin
Shog923-Jan-02 15:38
sitebuilderShog923-Jan-02 15:38 
GeneralRe: OnInitDialog called in Release, but not in Debug! Pin
Jonnie White24-Jan-02 0:21
Jonnie White24-Jan-02 0:21 
GeneralRegisterClass() in 98.. Pin
Neha23-Jan-02 0:51
Neha23-Jan-02 0:51 
GeneralRe: RegisterClass() in 98.. Pin
Michael P Butler23-Jan-02 0:53
Michael P Butler23-Jan-02 0:53 

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.