佚名通过本文主要向大家介绍了office大神,wince office,大神note3,酷派大神f2,大神等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题:windows office2003 大神们,基于wince下文件对话框怎么设置
描述:
解决方案1:
描述:
之前在windows下可以在文件对话框打开目录,打开文件另存为文件,但是在一体机wince下如何写代码??
解决方案1:
我测试了你的代码,在 WinCE 上运行正常,除了最后将获取到的路径显示到 EDIT 控件中。你不能打开目录,是什么现象?
我的测试代码如下:
void CSmartAppMFCDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
TCHAR szFilter[] = _T("文本文件(*.txt)|*.txt|所有文件(*.*)|*.*||");
// 构造打开文件对话框
CFileDialog fileDlg(TRUE, _T("txt"), NULL, 0, szFilter, this);
CString strFilePath;
// 显示打开文件对话框
if (IDOK == fileDlg.DoModal())
{
// 如果点击了文件对话框上的“打开”按钮,则将选择的文件路径显示到编辑框里
strFilePath = fileDlg.GetPathName();
RETAILMSG(1,(L"file name: %s\r\n",strFilePath));
}
}
void CSmartAppMFCDlg::OnBnClickedButton2()
{
// TODO: Add your control notification handler code here
// 设置过滤器
TCHAR szFilter[] = _T("文本文件(*.txt)|*.txt|Word文件(*.doc)|*.doc|所有文件(*.*)|*.*||");
// 构造保存文件对话框
CFileDialog fileDlg(FALSE, _T("doc"), _T("my"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, this);
CString strFilePath;
// 显示保存文件对话框
if (IDOK == fileDlg.DoModal())
{
// 如果点击了文件对话框上的“保存”按钮,则将选择的文件路径显示到编辑框里
strFilePath = fileDlg.GetPathName();
// SetDlgItemText(IDC_SAVE_EDIT, strFilePath);
RETAILMSG(1,(L"file name: %s\r\n",strFilePath));
}
}