Click here to Skip to main content
15,899,124 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhy can't delete CArray? [modified] Pin
followait25-Jun-08 23:48
followait25-Jun-08 23:48 
AnswerRe: Why can't delete CArray? Pin
Iain Clarke, Warrior Programmer25-Jun-08 23:56
Iain Clarke, Warrior Programmer25-Jun-08 23:56 
GeneralNo cookie for you. Pin
CPallini26-Jun-08 0:03
mveCPallini26-Jun-08 0:03 
GeneralNo Darjeeling tea for you. Pin
Rajesh R Subramanian26-Jun-08 0:05
professionalRajesh R Subramanian26-Jun-08 0:05 
GeneralRe: No Darjeeling tea for you. Pin
CPallini26-Jun-08 0:59
mveCPallini26-Jun-08 0:59 
AnswerBiscuit *now* ? Pin
Iain Clarke, Warrior Programmer26-Jun-08 0:09
Iain Clarke, Warrior Programmer26-Jun-08 0:09 
GeneralRe: Biscuit *now* ? Pin
followait26-Jun-08 0:36
followait26-Jun-08 0:36 
GeneralRe: Biscuit *now* ? Pin
Iain Clarke, Warrior Programmer26-Jun-08 1:02
Iain Clarke, Warrior Programmer26-Jun-08 1:02 
followait wrote:
Wait, the delete still crashes.


1/ You missed out how your item is initialised: ie, where pFig comes from.

2/ The following code works just fine.

class CItemData
{
public:
	CItemData (CArray<int,int&> *pFig)
	{
		m_pFig = pFig;
	}
	
	~CItemData()
	{
		delete m_pFig;
		TRACE0("m_pFig deleted nicely\n");
	}
	
protected:
	CArray<int,int> *m_pFig;
};

// somewhere later
    CItemData i (new CArray<int,int&>);


I made the array a simple one, as I couldn't be fussed finding my gdiplus headers. I also make sure that pFig has been allocated with new - is that true for your code?

Iain.

Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

QuestionRe: Biscuit *now* ? Pin
Mark Salsbery26-Jun-08 6:59
Mark Salsbery26-Jun-08 6:59 
AnswerRe: Biscuit *now* ? Pin
followait26-Jun-08 16:39
followait26-Jun-08 16:39 
GeneralRe: Biscuit *now* ? Pin
Mark Salsbery27-Jun-08 4:54
Mark Salsbery27-Jun-08 4:54 
Questionextracting portion of string Pin
projectip25-Jun-08 23:39
projectip25-Jun-08 23:39 
AnswerRe: extracting portion of string Pin
Rajesh R Subramanian25-Jun-08 23:46
professionalRajesh R Subramanian25-Jun-08 23:46 
AnswerRe: extracting portion of string Pin
Iain Clarke, Warrior Programmer25-Jun-08 23:47
Iain Clarke, Warrior Programmer25-Jun-08 23:47 
AnswerRe: extracting portion of string Pin
Hamid_RT27-Jun-08 8:13
Hamid_RT27-Jun-08 8:13 
QuestionValidation for CString type variable. Pin
Le@rner25-Jun-08 23:24
Le@rner25-Jun-08 23:24 
AnswerRe: Validation for CString type variable. [modified] Pin
toxcct25-Jun-08 23:26
toxcct25-Jun-08 23:26 
GeneralRe: Validation for CString type variable. Pin
Naveen25-Jun-08 23:31
Naveen25-Jun-08 23:31 
GeneralRe: Validation for CString type variable. Pin
toxcct25-Jun-08 23:33
toxcct25-Jun-08 23:33 
QuestionC++ directshow dll help Pin
boyindie25-Jun-08 23:14
boyindie25-Jun-08 23:14 
AnswerRe: C++ directshow dll help Pin
Mark Salsbery26-Jun-08 7:04
Mark Salsbery26-Jun-08 7:04 
Questionhow to calculate all columns amount? [modified] Pin
gentleguy25-Jun-08 23:08
gentleguy25-Jun-08 23:08 
QuestionRe: how to calculate all columns amount? Pin
Rajesh R Subramanian25-Jun-08 23:11
professionalRajesh R Subramanian25-Jun-08 23:11 
AnswerRe: how to calculate all columns amount? Pin
gentleguy25-Jun-08 23:36
gentleguy25-Jun-08 23:36 
AnswerRe: how to calculate all columns amount? Pin
Saurabh.Garg25-Jun-08 23:35
Saurabh.Garg25-Jun-08 23:35 

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.