×
Namespaces

Variants
Actions

Archived:Setting a default drive and directory for AknCommonDialogs

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.


Article Metadata
CompatibilityArticle
Created: User:Technical writer 2 (08 Feb 2007)
Last edited: hamishwillee (14 Jun 2012)

Overview

Setting a default drive and directory for AknCommonDialogs

Description

The following code example shows how the AknCommonDialogs class can be used to select the directories from a particular drive.

Solution

In the resources, declare the memory selection dialog as follows:
RESOURCE MEMORYSELECTIONDIALOG r_memory_selection_dialog
    {
    title = "title string";
    softkey_1 = "ok string";
    softkey_2 = "cancel string";
    locations =
        {
        LOCATION
            {
            \\ Replace <drive> with - c: for phone, e: for memory card
            \\ Replace <dir> with default directory
            root_path = "<drive>:\\";
            default_folder = "<drive>:\\<dir>";
            }
        };
    }
// In the cpp file, launch the AknCommonDialogs. RunSaveDlgLD() does not display the folder selection dialog - instead, the resulting path will be constructed from the root and default folder read from resources.
    LIT(filename ,"default"); // default file name to display in dialog
    TBuf<32> default_file_name;
    default_file_name.Copy(filename);
    AknCommonDialogs::RunSaveDlgLD(default_file_name, R_MEMORY_SELECTION_DIALOG);

This page was last modified on 14 June 2012, at 10:22.
54 page views in the last 30 days.
×