Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User zhangpengstu's Avatar
    Join Date
    Oct 2007
    Posts
    14
    My program is C++ code call C code,when exception(eg, null pointer ,array out of bandery) happened,what should I Do?
    I try to used TRAPD(err, fun()); method ,But Not any exception
    was catched . wether I used that not correct?
    Does symbian has (ECH )"_try _execption" method to catch the exception that programer need not to throw execption at all?

    I hope someone can help me!

  2. #2
    Registered User mikaellaine's Avatar
    Join Date
    Jan 2004
    Posts
    44
    Symbian has its own exception handling system (the TRAP macro you mentioned). It also has its own exceptions, so you can't use C++ exceptions here. For example:

    ..
    TRAPD(err, funL()); //Exception "catching"
    if(err == KErrNone){..} //Exception handling
    else{..}
    ..

    void Something::funL() //the function that can "throw" an exception
    {
    ..
    if(somethingterrible)
    {
    User::Leave( reasoncode ); //SYMBIAN EXCEPTION ("throw")
    }
    ..
    }

    If a function may leave (throw an exception), it has to have an 'L' at the end of its name.
    I'm not sure if this answers your question... I hope it does.

  3. #3
    Regular Contributor nigel.brown's Avatar
    Join Date
    Mar 2006
    Posts
    280
    http://wiki.forum.nokia.com/index.ph..._in_Symbian_OS
    http://wiki.forum.nokia.com/index.php/Panic
    http://wiki.forum.nokia.com/index.ph...ulltext=Search

    Understand the difference between a Panic and a Leave (sometimes, in some versions AKA Exception).

  4. #4
    Registered User zhangpengstu's Avatar
    Join Date
    Oct 2007
    Posts
    14
    "_try _execption" not need programer trow execption

    when the excepiton happend ,it can catch Mainly part of

    execption . I need the method that programer not need

    throw

  5. #5
    Regular Contributor nigel.brown's Avatar
    Join Date
    Mar 2006
    Posts
    280
    You could try User::SetExceptionHandler(), but you need to understand the difference between exceptions and panics as I said in the last post.

Similar Threads

  1. i got Exception when i call the high level screen from the canvas screen using comman
    By madnan_java in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-10-05, 13:50
  2. How to call nonexported virtual function
    By zhang_guoqing in forum Symbian C++
    Replies: 0
    Last Post: 2004-07-26, 08:23
  3. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29
  4. Call function - Direct from card
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2002-05-16, 13:29
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

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