WEB开发网
开发学院手机开发Symbian 开发 在 symbian 上使用文件浏览对话框 阅读

在 symbian 上使用文件浏览对话框

 2010-04-20 15:52:00 来源:WEB开发网   
核心提示:在symbian上使用文件浏览对话框#include#include //linke CommonDialogs.libTBool CDownloadedView::AskFileL(TFileName& aFileName){// Select memoryCAknMemorySelectionDialog* mem

在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:\”;

}

Tags:symbian 使用 文件

编辑录入:coldstar [复制链接] [打 印]
赞助商链接