「Windows Mobile ファイル選択ダイアログ」の版間の差分
ナビゲーションに移動
検索に移動
| (同じ利用者による、間の1版が非表示) | |||
| 1行目: | 1行目: | ||
| − | ==Windows Mobile ファイル選択ダイアログ== | + | ==[[Windows Mobile ファイル選択ダイアログ]]== |
| − | [[Windows Mobile][Visual Studio 2005]] | + | [[Windows Mobile]] | [[Visual Studio 2005]] | [[Category:MFC]] |
| − | *MFC ファイルを選択 | + | *[[MFC ファイルを選択]] |
| − | ====Windows Mobile 6 Standerd では、[MFC ファイルを選択] | + | ====Windows Mobile 6 Standerd では、[[MFC ファイルを選択|CFileDialog]] が利用できないので、GetOpenFileName APIを利用する。==== |
OPENFILENAME ofn; | OPENFILENAME ofn; | ||
CString fileName; | CString fileName; | ||
| 17行目: | 17行目: | ||
BOOL ret = GetOpenFileName(&ofn); | BOOL ret = GetOpenFileName(&ofn); | ||
if (ret) { | if (ret) { | ||
| − | + | T[[R]]ACE1("Selected file is : %s",fileName); | |
} | } | ||
| − | fileName. | + | fileName.[[R]]eleaseBuffer(); |
2020年2月16日 (日) 04:34時点における最新版
Windows Mobile ファイル選択ダイアログ
Windows Mobile | Visual Studio 2005 |
Windows Mobile 6 Standerd では、CFileDialog が利用できないので、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();
© 2006 矢木浩人