在 symbian 上使用文件浏览对话框
2010-04-20 15:52:00 来源:WEB开发网在symbian上使用文件浏览对话框
#include
#include //linke CommonDialogs.lib
TBool CDownloadedView::AskFileL(TFileName& aFileName)
{
// Select memory
CAknMemorySelectionDialog* memSelectionDialog =
CAknMemorySelectionDialog::NewL(ECFDDialogTypeNormal, EFalse);
CleanupStack::PushL(memSelectionDialog);
CAknMemorySelectionDialog::TMemory mem(CAknMemorySelectionDialog::EPhoneMemory);
TInt ret = memSelectionDialog->ExecuteL(mem);
CleanupStack::PopAndDestroy(memSelectionDialog);
if (!ret)
{
return EFalse;
}
//Select file from the chosen memory
CAknFileSelectionDialog* fileSelectionDialog = NULL;
if (mem == CAknMemorySelectionDialog::EMemoryCard)
{
fileSelectionDialog = CAknFileSelectionDialog::NewL(ECFDDialogTypeNormal,R_FILE_SELECTION_DIALOG_E );
}
else
{
fileSelectionDialog= CAknFileSelectionDialog::NewL(ECFDDialogTypeNormal,R_FILE_SELECTION_DIALOG_C );
}
TBool result = fileSelectionDialog->ExecuteL(aFileName);
delete fileSelectionDialog;
return result;
}
//rss
#include //FILESELECTIONDIALOG
#include
RESOURCE FILESELECTIONDIALOG r_file_selection_dialog_c
{
title = <0×9009><0×62e9><0×8d44><0×6e90>; //选择资源
root_path = “C:\”;
}
RESOURCE FILESELECTIONDIALOG r_file_selection_dialog_e
{
title = <0×9009><0×62e9><0×8d44><0×6e90>; //选择资源
root_path = “E:\”;
}
更多精彩
赞助商链接