×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    5

    Calling the WML browser from an application to view local .wmlc page

    Hi,

    I'm having trouble calling the WML browser in 7650 from a C++ application, when trying to view a locally saved .wmlc page. Actually the browser starts, but doesn't display the page. The page is created and compiled with Nokia Mobile Internet Toolkit 3.1 and when uploaded via bluetooth, the WML browser displays it correctly. So, then when copied to c:\ and executing the following code, it doesn't display:

    HBufC* param = HBufC::NewLC(20);
    param->Des().Copy(_L("c:\\readme.wmlc&quot);
    RApaLsSession appArcSession;
    User::LeaveIfError(appArcSession.Connect());
    TThreadId id;
    appArcSession.StartDocument(*param, id);
    appArcSession.Close();
    CleanupStack::PopAndDestroy();


    So again I repeat: the WML browser starts but instead of the page, displays its startup screen with the saved bookmarks ((
    Any ideas?

    regards,
    K.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    81

    RE: Calling the WML browser from an application to view local .wmlc page

    There are several different ways to start the web browser. You will find two posting related to the most frequently used ways:

    Searching for "How can i launch Wap Browser from an appli" will result a posting, containing an example how to launch the Wap browser itself.

    Searching for "Starting 7650 browser sedded with a url" result, containing the way, how can you open your local wmlc file.
    Note, that in the second case you have to include these two headers:

    #include "documenthandler.h"
    #include "apmstd.h"

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    55

    RE: Calling the WML browser from an application to view local .wmlc page

    Hi,
    Here is an example

    CDocumentHandler* iDocHandler = CDocumentHandler::NewLC( (CEikProcess*)Process() ) ;

    TDataType aDT( _L8("application/vnd.wap.wmlc&quot ) ;
    iDocHandler->OpenFileL( fileName, aDT ) ;

    CleanupStack::PopAndDestroy() ; // iDocHandler


    Don't forget to include the DocumentHandler.h and apmstd.h headers.

    Brg,
    Szabolcs Tolnai

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    18

    Complilation Error

    Hi ,

    Iam new to Symbian .. i tried the code mentioned above .. i added this to the HelloWorldPlus example given in the Series 60 SDK in the APPUI (HandleCommandL function).

    I get a compilation error on this line

    CDocumentHandler* iDocHandler = CDocumentHandler::NewLC( (CEikProcess*)Process() ) ;

    Error : undefined identifier 'Process'

    i have included the following headers
    #include <documenthandler.h>
    #include <apmstd.h>

    Is there anything else i need to include ?...

    Thanks

  5. #5
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    Here's how to launch the browser on a local file:

    1) See the launchwap example in http://discussion.forum.nokia.com/fo...threadid=21756

    2) Change the URL to a file URL, eg. file:///foo.wmlc (loads c:\foo.wmlc).

    Lauri

  6. #6
    Registered User
    Join Date
    Nov 2003
    Posts
    18

    Regarding the File URL

    Hi

    Thx for your response

    I tried specifying the path to the local file and it hasnt worked yet... i downloaded the LaunchWap example from the thread specified.

    I placed the page Hello.wmlc at c:\hello.wmlc

    This is how i tried to specify the path
    param->Des().Copy( _L( "file:///hello.wmlc/" ) );

    This opens up the WAP browser and then gives me the message

    Services: Page not found

    Is this the correct way to specify the path of the File

  7. #7
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    No, you'll need to tell the browser that the parameter is an URL. This code should work better:

    Code:
    param->Des().Copy( _L( "4 file:///hello.wmlc" ) );
    Lauri

    Edit: 2 Dec: Removed trailing slash from URL.
    Last edited by laa-laa; 2003-12-02 at 08:52.

  8. #8
    Registered User
    Join Date
    Nov 2003
    Posts
    18

    Success atlast

    Hi ,

    Thanks for your help that works...

    I do not want to place the page on C:\ drive unless i absolutely have to . I created a directory on c drive and want to place the page there.. however when i call the page from the program the App says that the service page could not be found.

    this is the way i have tried to call it

    param->Des().Copy( _L( "4 file://c:/local/index.wmlc/" ) );

    also,
    param->Des().Copy( _L( "4 file://c:/local//index.wmlc/" ) );

    any help is appreciated.

    thnx

  9. #9
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    URLs pointing to a file generally do not have a trailing slash. I forgot to remove it when I pasted your URL to my code example above.

    Lauri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •