MCPcopy Create free account
hub / github.com/ariccio/altWinDirStat / RunFileDialog

Function RunFileDialog

Reference code/osImageTool/OSImageToolDlg.cpp:189–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189void RunFileDialog(CComboBox& cCombo, bool bMustExist)
190{
191 CFileDialog cd( true, NULL, NULL, (bMustExist?OFN_FILEMUSTEXIST:0)|OFN_ENABLESIZING,
192 "Windows CE (*.nb1)|*.nb1|"
193 "ROM update files (*.nbf)|*.nbf|"
194 "BIN Flash files (*.bin)|*.bin|"
195 "SD card images (*.img)|*.img|"
196 "All files (*.*)|*.*||" );
197
198 TCHAR szCurDir[1024]; szCurDir[0]=0;
199
200 CString curfile;
201 cCombo.GetWindowText(curfile);
202
203 if (curfile.IsEmpty())
204 {
205 if (GetCurrentDirectory(1024, szCurDir)) {
206 cd.m_pOFN->lpstrInitialDir= szCurDir;
207 }
208 }
209 else {
210 cd.m_pOFN->lpstrInitialDir= curfile;
211 }
212 if( cd.DoModal()==IDOK )
213 {
214 cCombo.SetCurSel(CB_ERR);
215 cCombo.SetWindowText(cd.GetPathName());
216 }
217}
218void COSImageToolDlg::OnBnClickedBrowseSourceFile()
219{
220 RunFileDialog(m_cSource, true);

Calls 4

IsEmptyMethod · 0.45
DoModalMethod · 0.45
SetCurSelMethod · 0.45
SetWindowTextMethod · 0.45

Tested by

no test coverage detected