对话框中如何设置文件选择控制?用复合列表框吗,选择什么风格?
解决方案 »
- 请教大哥大姐!
- 创建二个工作线程,使用的是临界区对像.但是发现每个线程只运行了一次,我要它不断的运行,或者判断一下,如果条件成立的话就运行.
- CWnd自绘问题
- 一个简单的小问题,大家帮帮我
- msxml的问题
- 如何访问主窗口?
- VC++中类的析构函数不执行
- 麻烦过来人给小弟推荐基本windows网络程序设计的好书。
- 每次打开新的网页,新窗口总是最小化且位于屏幕的中间位置,怎么解决?
- 请问,我用activex dll做一个控件,而且用在asp中,打开网页是会自动打开word,写完文档后,要保存,你们知道记住保存路径的Api函数吗?因为记住路径后我便能实现自动的把文档提交到服务器。
- 求教:为什么我的程序在2003下正常,98下所有对话框不能显示?
- 请问CPropertySheet在对话框内如何最大化?
void CChildFrame::OnFileOpen()
{
// szFilters is a text string that includes two file name filters:
// "*.my" for "MyType Files" and "*.*' for "All Files."
char CChildFrame::szFilters[]=
"MyType Files (*.my)|*.my|All Files (*.*)|*.*||"; // Create an Open dialog; the default file name extension is ".my".
CFileDialog fileDlg (TRUE, "my", "*.my",
OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, szFilters, this);
// Display the file dialog. When user clicks OK, fileDlg.DoModal()
// returns IDOK.
if( fileDlg.DoModal ()==IDOK )
{
CString pathName = fileDlg.GetPathName();
// Implement opening and reading file in here.
...
//Change the window's title to the opened file's title.
CString fileName = fileDlg.GetFileTitle ();
SetWindowText(fileName);
}