トップ 一覧 ping 検索 ヘルプ RSS ログイン

Windows Mobile ファイル選択ダイアログの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!Windows Mobile ファイル選択ダイアログ
[Windows Mobile][Visual Studio 2005]{{category MFC}}

*MFC ファイルを選択

!Windows Mobile 6 Standerd では、[[CFileDialog|MFC ファイルを選択]] が利用できないので、GetOpenFileName APIを利用する。
 OPENFILENAME ofn;
 CString fileName;

 
 ZeroMemory( &ofn, sizeof(ofn) );
 ofn.lStructSize = sizeof(OPENFILENAME);
 ofn.lpstrFile   = fileName.GetBuffer(MAX_PATH);
 ofn.nMaxFile    = MAX_PATH;
 ofn.Flags       = OFN_FILEMUSTEXIST;
 ofn.lpstrFilter =  _T("All Files\0*.*\0");

 
 BOOL ret = GetOpenFileName(&ofn);
 if (ret) {
  TRACE1("Selected file is : %s",fileName);
 }
 fileName.ReleaseBuffer();