Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Suppressing Next button on wizard Pin
Lilian Chan-Grant3-Oct-02 9:15
Lilian Chan-Grant3-Oct-02 9:15 
Generalscreen size Pin
Kash3-Oct-02 6:33
Kash3-Oct-02 6:33 
GeneralRe: screen size Pin
Tomasz Sowinski3-Oct-02 6:50
Tomasz Sowinski3-Oct-02 6:50 
GeneralVisible Client Area question Pin
Steve The Plant3-Oct-02 6:12
Steve The Plant3-Oct-02 6:12 
GeneralRe: Visible Client Area question Pin
Tomasz Sowinski3-Oct-02 6:26
Tomasz Sowinski3-Oct-02 6:26 
GeneralRe: Visible Client Area question Pin
JT Anderson3-Oct-02 10:53
JT Anderson3-Oct-02 10:53 
QuestionHow do I use a CSortListCtrl in ListView? Pin
Pole3-Oct-02 5:56
Pole3-Oct-02 5:56 
Generalcrash on exit Pin
ns3-Oct-02 5:44
ns3-Oct-02 5:44 
It seems to work, but crashes when I exit with Ok or the system menu.

The UI comes up just fine! If I comment out AddItem1, it exits fine:

BOOL CSortListCtrlTestDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	(void)m_ctlList.SetExtendedStyle( LVS_EX_FULLROWSELECT );
	m_ctlList.SetHeadings( _T("Name,120;Date of Birth,90;Score,50;Score,200") );

	CStringArray  pArray;

	int iArraySize = 4;

	pArray.Add("ccc");
	pArray.Add ("ppp");
	m_ctlList.AddItem1(pArray,  iArraySize , 0);

	return TRUE;  // return TRUE  unless you set the focus to a control
}


and

int CSortListCtrl::AddItem1( CStringArray &pArray, int iArraySize , int nPos)
{

    int nIndex = InsertItem(LVIF_TEXT|LVIF_STATE, 0, "abc",0,LVIS_SELECTED,0,0);
    ASSERT(nIndex != -1);
    if (nIndex < 0) return(nIndex);
    return(nIndex);
}


I dont use any of the info I passed in (for testing). I dont do anything fancy. This is the barest code with which it crashes in OnDestroy
which has only CDialogs destroy in it. If I comment out the InsertItem it exits fine. if I use instead

int nIndex = InsertItem( 0, "abv");
, it still crashes

What shall I look at here that might be the problem?

Appreciate your help,
ns
GeneralRe: crash on exit Pin
Tomasz Sowinski3-Oct-02 5:49
Tomasz Sowinski3-Oct-02 5:49 
GeneralRe: crash on exit Pin
ns3-Oct-02 6:10
ns3-Oct-02 6:10 
GeneralRe: crash on exit Pin
ns3-Oct-02 6:13
ns3-Oct-02 6:13 
GeneralRe: crash on exit Pin
Tomasz Sowinski3-Oct-02 6:11
Tomasz Sowinski3-Oct-02 6:11 
GeneralRe: crash on exit Pin
ns3-Oct-02 6:28
ns3-Oct-02 6:28 
GeneralRe: crash on exit Pin
Tomasz Sowinski3-Oct-02 6:35
Tomasz Sowinski3-Oct-02 6:35 
GeneralRe: crash on exit Pin
ns3-Oct-02 6:51
ns3-Oct-02 6:51 
GeneralRe: crash on exit Pin
Tomasz Sowinski3-Oct-02 6:54
Tomasz Sowinski3-Oct-02 6:54 
GeneralRe: crash on exit Pin
ns3-Oct-02 7:10
ns3-Oct-02 7:10 
GeneralRe: crash on exit Pin
Tomasz Sowinski3-Oct-02 7:19
Tomasz Sowinski3-Oct-02 7:19 
Generalits working!!!! Pin
ns3-Oct-02 7:37
ns3-Oct-02 7:37 
GeneralRe: its working!!!! Pin
Ravi Bhavnani3-Oct-02 7:57
professionalRavi Bhavnani3-Oct-02 7:57 
GeneralRe: its working!!!! Pin
ns3-Oct-02 8:08
ns3-Oct-02 8:08 
QuestionActiveX Question? Pin
Mr_Byte3-Oct-02 5:26
Mr_Byte3-Oct-02 5:26 
AnswerRe: ActiveX Question? Pin
Stephane Rodriguez.3-Oct-02 6:53
Stephane Rodriguez.3-Oct-02 6:53 
AnswerRe: ActiveX Question? Pin
Nitron3-Oct-02 7:14
Nitron3-Oct-02 7:14 
AnswerRe: ActiveX Question? Pin
l a u r e n3-Oct-02 7:15
l a u r e n3-Oct-02 7:15 

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.