Click here to Skip to main content
15,915,509 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reverse_iterator Pin
Hosam Aly Mahmoud15-Sep-03 23:07
Hosam Aly Mahmoud15-Sep-03 23:07 
QuestionControl on a ScrollView that doesn't scroll. How to achieve this? Pin
steven1115-Sep-03 19:24
steven1115-Sep-03 19:24 
GeneralMulti dimensional array using pointer notation Pin
Anonymous15-Sep-03 19:06
Anonymous15-Sep-03 19:06 
Generaldiagonal controls Pin
r i s h a b h s15-Sep-03 18:51
r i s h a b h s15-Sep-03 18:51 
GeneralRe: diagonal controls Pin
Hosam Aly Mahmoud15-Sep-03 20:48
Hosam Aly Mahmoud15-Sep-03 20:48 
GeneralRe: diagonal controls Pin
Joey Bloggs16-Sep-03 1:49
Joey Bloggs16-Sep-03 1:49 
GeneralRe: diagonal controls Pin
r i s h a b h s16-Sep-03 18:41
r i s h a b h s16-Sep-03 18:41 
Generalmemory leak problem in dialog based app Pin
r i s h a b h s15-Sep-03 18:44
r i s h a b h s15-Sep-03 18:44 
dear all,
i'm creating controls at runtime in my dlg based mfc application. the number of controls is unknown to me. the problem is i'm allocating memory to the controls in a function....so i've no idea when and where to free the memory coz the control variables are decalared and accessible within the function only. i've attached a snippet of my code :- plz. tell me how to make the code cleaner and get rid of memory leaks

<br />
void CRms::CreateControls()<br />
{<br />
	int iCtr;<br />
	CRect rcLabel, rcDtc;	<br />
	COleDateTime dt;<br />
	dt.SetTime(0,0,0);<br />
	for (iCtr = 0 ; iCtr < iMaxEmails; iCtr++)<br />
	{<br />
		CString sCtr, sLabel;<br />
		CStatic *pText = new CStatic();<br />
		CDateTimeCtrl *pTime = new CDateTimeCtrl();<br />
		GetLabelRect(iCtr, rcLabel);<br />
		GetDTCRect(iCtr, rcDtc);<br />
		m_arrayStatic.Add(pText);<br />
		m_arrayDTC.Add(pTime);<br />
		sCtr.Format("%d", iCtr + 1);<br />
		sLabel = LABEL_CAPTION + sCtr;<br />
		pText->Create(sLabel, WS_VISIBLE, rcLabel, this, ID_LABEL + iCtr);<br />
			<br />
	        pTime->Create(DTS_TIMEFORMAT |WS_VISIBLE  , rcDtc, this, ID_DTC + iCtr);<br />
		pTime->SetFormat("HH:mm");<br />
		pTime->SetTime(dt);<br />
		bControlsLoaded = true;<br />
	}<br />
}<br />


thanx and regards


rIsHaBh
GeneralRe: memory leak problem in dialog based app Pin
Bernhard15-Sep-03 19:29
Bernhard15-Sep-03 19:29 
GeneralRe: memory leak problem in dialog based app Pin
r i s h a b h s15-Sep-03 22:01
r i s h a b h s15-Sep-03 22:01 
GeneralRe: memory leak problem in dialog based app Pin
jhwurmbach15-Sep-03 23:01
jhwurmbach15-Sep-03 23:01 
GeneralRe: memory leak problem in dialog based app Pin
r i s h a b h s15-Sep-03 23:23
r i s h a b h s15-Sep-03 23:23 
GeneralRe: memory leak problem in dialog based app Pin
Jagadeesh VN16-Sep-03 1:30
Jagadeesh VN16-Sep-03 1:30 
GeneralRe: memory leak problem in dialog based app Pin
David Crow16-Sep-03 5:03
David Crow16-Sep-03 5:03 
GeneralRe: memory leak problem in dialog based app Pin
r i s h a b h s16-Sep-03 18:39
r i s h a b h s16-Sep-03 18:39 
GeneralRe: memory leak problem in dialog based app Pin
David Crow17-Sep-03 2:29
David Crow17-Sep-03 2:29 
GeneralRe: memory leak problem in dialog based app Pin
r i s h a b h s25-Sep-03 18:37
r i s h a b h s25-Sep-03 18:37 
GeneralWMP Player 9(CWMPPlayer4) frame control and dragging Pin
RichardWdy15-Sep-03 16:35
RichardWdy15-Sep-03 16:35 
GeneralRe: WMP Player 9(CWMPPlayer4) frame control and dragging Pin
RichardWdy15-Sep-03 16:41
RichardWdy15-Sep-03 16:41 
GeneralToolbars and Dialogs Pin
Florin Ochiana15-Sep-03 14:34
Florin Ochiana15-Sep-03 14:34 
GeneralRe: Toolbars and Dialogs Pin
Jagadeesh VN16-Sep-03 1:32
Jagadeesh VN16-Sep-03 1:32 
GeneralRe: Toolbars and Dialogs Pin
Florin Ochiana16-Sep-03 1:50
Florin Ochiana16-Sep-03 1:50 
GeneralTreeCtrl and ListCtrl Urgent help needed Pin
kumaru_san15-Sep-03 14:25
kumaru_san15-Sep-03 14:25 
GeneralRe: TreeCtrl and ListCtrl Urgent help needed Pin
David Crow16-Sep-03 5:06
David Crow16-Sep-03 5:06 
QuestionHow to load program at start up? Pin
aidanz15-Sep-03 13:52
aidanz15-Sep-03 13:52 

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.