トップ 差分 一覧 ping ソース 検索 ヘルプ PDF RSS ログイン

Windows Mobile ファイル選択ダイアログ



目次



記事一覧

キーワード

Windows Mobile ファイル選択ダイアログ

[Windows Mobile][Visual Studio 2005][MFC]


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



YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto

Copyright© 矢木 浩人 All Rights Reserved.