Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Setting a default drive and directory for AknCommonDialogs

From 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
Created: User:Technical writer 2 (08 Feb 2007)
Last edited: hamishwillee (14 Jun 2012)


Setting a default drive and directory for AknCommonDialogs


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


In the resources, declare the memory selection dialog as follows:
    title = "title string";
    softkey_1 = "ok string";
    softkey_2 = "cancel string";
    locations =
            \\ 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;
    AknCommonDialogs::RunSaveDlgLD(default_file_name, R_MEMORY_SELECTION_DIALOG);

This page was last modified on 14 June 2012, at 07:22.
35 page views in the last 30 days.