路人超能漫画:在symbian上使用文件浏览对话框

来源:百度文库 编辑:九乡新闻网 时间:2024/04/25 23:37:15

在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 = <0x9009><0x62e9><0x8d44><0x6e90>; //选择资源
root_path = "C:\\";
}

RESOURCE FILESELECTIONDIALOG r_file_selection_dialog_e
{
title = <0x9009><0x62e9><0x8d44><0x6e90>; //选择资源
root_path = "E:\\";
}