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();
}

 

 

+ Recent posts