Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with "vector<CString> StringVector" Pin
Joaquín M López Muñoz26-Nov-02 0:28
Joaquín M López Muñoz26-Nov-02 0:28 
GeneralRe: Problem with "vector<CString> StringVector" Pin
Alexandru Savescu26-Nov-02 0:49
Alexandru Savescu26-Nov-02 0:49 
GeneralGUI goes all funny and system hangs Pin
louis25-Nov-02 23:24
louis25-Nov-02 23:24 
GeneralRe: GUI goes all funny and system hangs Pin
KaЯl25-Nov-02 23:42
KaЯl25-Nov-02 23:42 
GeneralRe: GUI goes all funny and system hangs Pin
louis26-Nov-02 20:03
louis26-Nov-02 20:03 
GeneralRe: GUI goes all funny and system hangs Pin
Roger Allen26-Nov-02 1:38
Roger Allen26-Nov-02 1:38 
GeneralRe: GUI goes all funny and system hangs Pin
louis26-Nov-02 20:18
louis26-Nov-02 20:18 
GeneralRe: GUI goes all funny and system hangs Pin
perlmunger26-Nov-02 6:53
perlmunger26-Nov-02 6:53 
I've had this same problem myself. You have a resource leak (as others have noted). If you want to debug your resource consumption, you can use the task manager. Now, I'm not sure that this is the same in NT, but under Win2K open the Task Manager and select the "Process" tab. Then click the "View | Set Columns..." menu item. In the resulting dialog, make sure you have "GDI Objects" checked and click "Ok". Now, run your application and watch the "GDI Objects" column. You will, in all liklihood, see your object count go up to something like 8000 or 9000 and then crash. At least that's what happened to me.

As others have noted you need to release your resources when you're done using them including any new DCs you've created. Make sure you call ReleaseDC on any new DCs you've created with CreateCompatibleDC, or any other DC creation mechanism, when you're done with it. This is where the vast majority of my problems were. Once I fixed them all, my app only used 34 GDI objects (on average).

Hope this helps.

-Matt

------------------------------------------

The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
GeneralBlock Internet access !! Pin
onkarp25-Nov-02 23:16
onkarp25-Nov-02 23:16 
GeneralRe: Block Internet access !! Pin
perlmunger26-Nov-02 6:39
perlmunger26-Nov-02 6:39 
GeneralRe: Block Internet access !! Pin
Scott H. Settlemier26-Nov-02 7:29
Scott H. Settlemier26-Nov-02 7:29 
GeneralWideCharToMultiByte Pin
candan25-Nov-02 22:43
professionalcandan25-Nov-02 22:43 
GeneralRe: WideCharToMultiByte Pin
Christian Graus25-Nov-02 23:06
protectorChristian Graus25-Nov-02 23:06 
GeneralRe: WideCharToMultiByte Pin
candan26-Nov-02 14:40
professionalcandan26-Nov-02 14:40 
GeneralRe: WideCharToMultiByte Pin
Christian Graus26-Nov-02 15:33
protectorChristian Graus26-Nov-02 15:33 
GeneralConvert to widechar Pin
Member 910463223-Jan-14 4:09
Member 910463223-Jan-14 4:09 
GeneralProblems with Microsoft Forms 2.0 Frame Control Pin
jmgir25-Nov-02 22:31
jmgir25-Nov-02 22:31 
Generalreadind an excel cell from MFC app Pin
sinouhe25-Nov-02 22:19
sinouhe25-Nov-02 22:19 
GeneralRe: readind an excel cell from MFC app Pin
perlmunger26-Nov-02 6:25
perlmunger26-Nov-02 6:25 
GeneralCreate a window in an ATL control Pin
Jerome Conus25-Nov-02 22:02
Jerome Conus25-Nov-02 22:02 
QuestionDynamicly create controls in dialog + scroll bar? Pin
anonimous25-Nov-02 21:53
anonimous25-Nov-02 21:53 
AnswerRe: Dynamicly create controls in dialog + scroll bar? Pin
Anonymous26-Nov-02 11:23
Anonymous26-Nov-02 11:23 
QuestionHow to get NT group name from Windows 9x/ME client? Pin
Ruxo Zheng25-Nov-02 20:15
Ruxo Zheng25-Nov-02 20:15 
Generalhelp: ODBC CRecordSet update delay.. Pin
trustno125-Nov-02 18:42
trustno125-Nov-02 18:42 
GeneralSetItemText Pin
David Kadish25-Nov-02 18:33
David Kadish25-Nov-02 18:33 

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.