Click here to Skip to main content
16,010,918 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCompletion Ports and ODBC Pin
Dave-B3-Jan-03 3:37
Dave-B3-Jan-03 3:37 
GeneralRe: Completion Ports and ODBC Pin
NormDroid3-Jan-03 3:46
professionalNormDroid3-Jan-03 3:46 
GeneralRe: Completion Ports and ODBC Pin
Dave-B3-Jan-03 4:02
Dave-B3-Jan-03 4:02 
GeneralRe: Completion Ports and ODBC Pin
Anders Molin3-Jan-03 13:55
professionalAnders Molin3-Jan-03 13:55 
QuestionDo I have a resource leak? Pin
georgiek503-Jan-03 2:36
georgiek503-Jan-03 2:36 
AnswerRe: Do I have a resource leak? Pin
Joaquín M López Muñoz3-Jan-03 2:49
Joaquín M López Muñoz3-Jan-03 2:49 
GeneralRe: Do I have a resource leak? Pin
georgiek503-Jan-03 6:34
georgiek503-Jan-03 6:34 
GeneralRe: Do I have a resource leak? Pin
Joaquín M López Muñoz3-Jan-03 7:33
Joaquín M López Muñoz3-Jan-03 7:33 
Well, you're having massive resource leaks here: Every time InfoTabChildDlgProc is called (and it's called many times during the life of a dialog box) you create a fresh HBRUSH. The way to have one and only one brush is by defining hControlBrush as static. Also, by combinig this fix with the count of instances hack, you'll ge the following:
BOOL CALLBACK InfoTabChildDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	static HBRUSH hControlBrush;
	static unsigned int nCount=0;
...
		case WM_INITDIALOG:
			if(nCount++==0){
				hControlBrush = CreateSolidBrush( RGB(170, 170, 213) );
			}
			return TRUE;
...
		case WM_DESTROY:
			if(--nCount==0){
				DeleteObject(hControlBrush);
			}
			EndDialog(hDlg, 0);
			return TRUE;
...
}
Hope this helps, regards,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Do I have a resource leak? Pin
georgiek503-Jan-03 10:48
georgiek503-Jan-03 10:48 
General_execv from one console app to another Pin
Anonymous3-Jan-03 2:20
Anonymous3-Jan-03 2:20 
GeneralRe: _execv from one console app to another Pin
Anders Molin3-Jan-03 2:33
professionalAnders Molin3-Jan-03 2:33 
GeneralRe: _execv from one console app to another Pin
Anonymous3-Jan-03 2:37
Anonymous3-Jan-03 2:37 
GeneralRe: _execv from one console app to another Pin
Joaquín M López Muñoz3-Jan-03 3:03
Joaquín M López Muñoz3-Jan-03 3:03 
GeneralRe: _execv from one console app to another Pin
Anonymous3-Jan-03 3:14
Anonymous3-Jan-03 3:14 
GeneralRe: _execv from one console app to another Pin
Joaquín M López Muñoz3-Jan-03 5:06
Joaquín M López Muñoz3-Jan-03 5:06 
Generalopen file dialog, custom template, opengl and thread.... Pin
haust3-Jan-03 2:17
haust3-Jan-03 2:17 
GeneralRe: open file dialog, custom template, opengl and thread.... Pin
AlexO3-Jan-03 2:41
AlexO3-Jan-03 2:41 
GeneralRe: open file dialog, custom template, opengl and thread.... Pin
haust3-Jan-03 5:56
haust3-Jan-03 5:56 
GeneralFormView sizes to its Initial size Pin
Arjan Schouten3-Jan-03 2:10
Arjan Schouten3-Jan-03 2:10 
GeneralPlaySound Problem Pin
Anders Molin3-Jan-03 2:03
professionalAnders Molin3-Jan-03 2:03 
Generalequalize 2 objects of 1 class! Pin
HellShrimp4free3-Jan-03 1:31
HellShrimp4free3-Jan-03 1:31 
GeneralRe: equalize 2 objects of 1 class! Pin
Joaquín M López Muñoz3-Jan-03 2:18
Joaquín M López Muñoz3-Jan-03 2:18 
GeneralRe: equalize 2 objects of 1 class! Pin
HellShrimp4free3-Jan-03 3:28
HellShrimp4free3-Jan-03 3:28 
GeneralRe: equalize 2 objects of 1 class! Pin
Joaquín M López Muñoz3-Jan-03 3:31
Joaquín M López Muñoz3-Jan-03 3:31 
GeneralRe: equalize 2 objects of 1 class! Pin
HellShrimp4free3-Jan-03 3:53
HellShrimp4free3-Jan-03 3: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.