构析函数

来源:互联网 发布:罗技游戏鼠标推荐 知乎 编辑:程序博客网 时间:2024/06/06 16:43

在构造函数中声明的变量;

BOOL CPropListBoxDlg::CPropertyitem(){CDialog::OnInitDialog();// Set the icon for this dialog.  The framework does this automatically//  when the application's main window is not a dialogSetIcon(m_hIcon, TRUE);// Set big iconSetIcon(m_hIcon, FALSE);// Set small icon//Add properties to the property list boxpropItem1 = new CPropertyItem("ToolTip Text","",PIT_EDIT,"");m_propList.AddPropItem(propItem1);propItem2 = new CPropertyItem("Enabled","true",PIT_COMBO,"true|false|");m_propList.AddPropItem(propItem2);propItem3 = new CPropertyItem("Visible","true",PIT_COMBO,"true|false|");m_propList.AddPropItem(propItem3);propItem4 = new CPropertyItem("Fore. Color","",PIT_COLOR,"");m_propList.AddPropItem(propItem4);propItem5 = new CPropertyItem("Back. Color","",PIT_COLOR,"");m_propList.AddPropItem(propItem5);propItem6 = new CPropertyItem("Opaque","false",PIT_COMBO,"true|false|");m_propList.AddPropItem(propItem6);propItem7 = new CPropertyItem("Auto. Scroll","true",PIT_COMBO,"true|false|");m_propList.AddPropItem(propItem7);         return TURE;}

在构析函数中要delete:

CPropListBoxDlg::~CPropListBoxDlg(){ delete propItem1; delete propItem2; delete propItem3; delete propItem4; delete propItem5; delete propItem6; delete propItem7;}


 


 

原创粉丝点击