编辑框控件在程序初始化时注入一个文本文件的内容.txt
来自「vc开发的PCI总线加密卡 PCI开发卡主要由PCI9054、93C56、16」· 文本 代码 · 共 36 行
TXT
36 行
编辑框控件在程序初始化时注入一个文本文件的内容
2003-4-23 12:47:33 VCTOP 阅读次数: 19274
编辑框控件在程序初始化时注入一个文本文件的内容
在头文件中加入CString m_LANINFO;
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CFile f;
if ( f.Open("F:\\PUBLIC\\laninfo.dat", CFile::modeRead)==
FALSE )
return;
//Creare an archive odject
CArchive ar( &f, CArchive::load );
//Serialzie data from the archive into m_NumbersEdit
ar >> m_LANINFO;
//Close the archive
ar.Close();
//Close the file.
f.Close();
m_EditControl.SetWindowText (m_LANINFO); // Do it the direct way.
return TRUE;
// return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?