本文整理汇总了C++中CFileDialog::GetOFN方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileDialog::GetOFN方法的具体用法?C++ CFileDialog::GetOFN怎么用?C++ CFileDialog::GetOFN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileDialog
的用法示例。
在下文中一共展示了CFileDialog::GetOFN方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fileDlg
void CInv3DDoc::OnModelImportAppend()
{
CFileDialog fileDlg (TRUE, _T(""), _T("*.*"), OFN_HIDEREADONLY, _T(""));
OPENFILENAME& ofn = fileDlg.GetOFN();
CString strDlg("Append model");
ofn.lpstrTitle = strDlg;
if( fileDlg.DoModal() == IDOK ) {
CString strFilePath = fileDlg.GetPathName();
ImportModel(strFilePath, TRUE);
}
}
示例2: on_click_browse
//
// on_click_browse
//
void Template_Engine_Dialog::on_click_browse (void)
{
CFileDialog dialog (1,
0,
0,
OFN_PATHMUSTEXIST,
0,
this,
0);
dialog.GetOFN ().lpstrTitle = "Open template configuration...";
if (IDOK == dialog.DoModal ())
this->config_.SetWindowText (dialog.GetPathName ());
}
示例3: OnBnClickedBrowseModelName
void CDlgDefineModel::OnBnClickedBrowseModelName()
{
CFileDialog fileDlg (FALSE, _T(""), _T("*.*"), OFN_HIDEREADONLY, _T(""), this);
OPENFILENAME& ofn = fileDlg.GetOFN();
CString strDlg("Specify model root name");
ofn.lpstrTitle = strDlg;
if( fileDlg.DoModal() == IDOK ) {
CString strExt = fileDlg.GetFileExt();
CString strName = fileDlg.GetFileName();
m_strFilePathModel = fileDlg.GetPathName();
if( !strExt.IsEmpty()) {
m_strFilePathModel.Replace( _T(".")+strExt, _T(""));
}
if( !strName.IsEmpty()) {
m_strFilePathTmp.Replace( _T("\\")+strName, _T(""));
}
m_pInvFcs->SetFileRoot( m_strFilePathModel );
m_pInvFcs->SetPathTmp( m_strFilePathModel );
SetDlgItemText(IDC_MODEL_NAME, m_strFilePathModel);
SetDlgItemText(IDC_TEMP_DIR, m_strFilePathModel);
}
}