Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User dennis_tort's Avatar
    Join Date
    Feb 2004
    Posts
    1
    * I'm using Borland C++ for series 60.

    * I've created an application with 3 Menus (1. HELLOWORLD, 2. MESSAGE, 3. EXIT)

    * choosing the HELLOWORLD menu displays the universal "Hello world!" message

    * but in choosing MESSAGE menu, I was hoping to have the contents of a .TXT file displayed. (The .TXT file is located in a folder in the phone)

    * below is part of the code found in the .cpp, the one that handles the menu commands (based on hello world example)

    **********************

    void CHelloWorldAppUi::HandleCommandL(TInt aCommand)
    {
    switch(aCommand)
    {
    case EEikCmdExit:

    case EAknSoftkeyExit:
    Exit();
    break;

    case EHelloWorldCommand1:
    {
    _LIT(message,"Hello!");
    CAknInformationNote* informationNote =
    new (ELeave) CAknInformationNote;
    informationNote->ExecuteLD(message);
    }
    break;

    case EMessageCommand1:
    {

    /* This part would display the contents of a .txt file which is located in the phone in a certain folder. The program would open it from there and display its contents. */

    /* Actually I would have wanted that the text file is located in a computer. Then the phone application would access the text file using Bluetooth. Then it would download it in a folder in the phone, then display its contents. But i guess my former inquiry would be okay for now =) */

    }
    break;

    default:
    Panic(EHelloWorldBasicUi);
    break;
    }

    ***********************

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    For reading the file you could use RFile or RFileReadStream classes, so example code, just search this forum, there should be plenty of samples there.

    For displaying the file on the screen, see edwin example in the SDK. Sample of how to use CEikEdwin & related classes should also be found from this forum.

    yucca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved