void CTestlistDlg::OnButton1() 
{
// TODO: Add your control notification handler code here
dialog2 a2;
a2.DoModal();
}
#if !defined(AFX_DIALOG2_H__9E17BA03_9DC2_4644_A85D_CC6DEC5A77C8__INCLUDED_)
#define AFX_DIALOG2_H__9E17BA03_9DC2_4644_A85D_CC6DEC5A77C8__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif
class dialog2 : public CDialog
{public:
dialog2(CWnd* pParent = NULL);   
BOOL OnInitDialog();
enum { IDD = IDD_DIALOG1 };
CListCtrl a; protected:
virtual void DoDataExchange(CDataExchange* pDX);     protected: afx_msg void OnButton1(); DECLARE_MESSAGE_MAP()
};
#endif #include "stdafx.h"
#include "testlist.h"
#include "dialog2.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
dialog2::dialog2(CWnd* pParent /*=NULL*/)
: CDialog(dialog2::IDD, pParent)
{
}
void dialog2::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST1, a);
}
BEGIN_MESSAGE_MAP(dialog2, CDialog)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
END_MESSAGE_MAP()void dialog2::OnButton1() 
{
}
BOOL dialog2::OnInitDialog()
{
a.InsertColumn(0,"书名",LVCFMT_LEFT,-1,-1);
return true;
};  
  
 
   对了,都是运行时提示"afxcmn.inl"……然后按retry,有个小箭头指向:
_AFXCMN_INLINE int CListCtrl::InsertColumn(int nCol, const LVCOLUMN* pColumn)
-〉〉〉〉 { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn); }
_AFXCMN_INLINE BOOL CListCtrl::DeleteColumn(int nCol)
{ ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETECOLUMN, nCol, 0); }
在线等了……