1. Find Dialog Box를 생성해보자
bool CPG_SendDlg::FindTDDialog(int mode)
{
// TODO: Add your control notification handler code here
CFileDialog fDlg(TRUE); // file open
fDlg.m_ofn.lpstrTitle = "search! TD ROM *.pof Files";
fDlg.m_ofn.lpstrInitialDir = "c:/";
char szFilter[] = "pof Files (*.pof)\0*.pof\0All Files (*.*)\0*.*\0\0";
fDlg.m_ofn.lpstrFilter = szFilter;
// file select... not cancle
if(fDlg.DoModal() == 1){
m_sFilepath = fDlg.GetPathName();
m_sFilename = fDlg.GetFileName();
int pos=0;
CString tempstr = m_sFilepath.Tokenize(" ",pos);
int comparesize=m_sFilepath.GetLength();
if((pos-1) != comparesize) {
AfxMessageBox("Rom data File. full path Error!! confirm Please...\r\n"
"==> blank existence in fullpath(quartus not execute)!!");
return false;
}
CString temp=" "+m_sFilename;
GetDlgItem(mode)->SetWindowText(temp);
m_sTDpath[mode-IDC_PE1DP] = m_sFilepath;
m_sTDname[mode-IDC_PE1DP] = m_sFilename;
}
return true;
}
or
static char szFilter[] = "dll Files(*.dll)|*.dll";
CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT , szFilter, NULL);
dlg.m_ofn.nMaxFile = MAX_PATH;
if (dlg.DoModal() == IDOK)
{
CString strpath = dlg.GetPathName(); // 파일의 풀 디렉토리 명을 얻는다.
CDevLink->SetDeviceName(strpath);
m_ctlEditDevPathDisp.SetWindowTextA(strpath);
Invalidate();
}
'프로그래밍 > VC++ 개발 코딩' 카테고리의 다른 글
Command 명령 실행, 제어 SpawnAndRedirect (0) | 2014.01.17 |
---|---|
Radio Button(라디오버튼) 사용 (0) | 2014.01.17 |
VC2003 명령중 컴파일(Command line compile) (0) | 2014.01.17 |
Process 안전하게 종료시키자 (0) | 2014.01.17 |
현재시간구하기 (0) | 2014.01.17 |