Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 742499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:45:18+00:00 2026-05-14T08:45:18+00:00

I’ve been given some Symbian C++ code to port over for use with the

  • 0

I’ve been given some Symbian C++ code to port over for use with the Android NDK.

The code has lots of Symbian specific code in it and I have very little experience of C++ so its not going very well.

The main thing that is slowing me down is trying to figure out the alternatives to use in normal C++ for the Symbian specific code.

At the minute the compiler is throwing out all sorts of errors for unrecognised types.

From my recent research these are the types that I believe are Symbian specific:

TInt, TBool, TDesc8, RSocket, TInetAddress, TBuf, HBufc,
RPointerArray

Changing TInt and TBool to int and bool respectively works in the compiler but I am unsure what to use for the other types?

Can anyone help me out with them? Especially TDesc, TBuf, HBuf and RPointerArray.


Also Symbian has a two phase contructor using

NewL

and

NewLc

But would changing this to a normal C++ constructor be ok?


Finally Symbian uses the clean up stack to help eliminate memory leaks I believe, would removing the clean up stack code be acceptable, I presume it should be replaced with try/catch statements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:45:19+00:00Added an answer on May 14, 2026 at 8:45 am

    It would typically be a bad idea to try and port Symbian OS C++ to standard C++ without having a very good understanding of what the Symbian idioms do.

    This could very well be one of these projects where the right thing to do is to rewrite most of the code pretty much from scratch. If you barely know the language you are targetting, there is little point in deluding yourself into thinking you won’t make mistakes, waste time and throw away new code anyway. It’s all part of learning.

    The CleanupStack mechanism is meant to help you deal with anything that could go wrong, including power outage and out of memory conditions. Technically, these days, it is implemented as C++ exceptions but it covers more than the usual error cases standard C++ code normally handles.

    Descriptors (TDesc, TBuf and HBuf all belong to the descriptor class hierarchy) and templates (arrays, queues, lists…) predate their equivalent in standard C++ while dealing with issues like the CleanupStack, coding standards, memory management and integrity…

    A relevant plug if you want to learn about it: Quick Recipes On Symbian OS is a recent attempt at explaning it all in as few pages as possible.

    You should also definitely look at the Foundation website to get started.

    Classes prefixed by T are meant to be small enough by themselves that they can be allocated on the stack.

    Descriptor classes suffixed by C are meant to be immutable (A mutable descriptor can usually be created from them, though).

    HBufC is pretty much the only Symbian class prefixed by H. It should always be allocated on the Heap.

    A method suffixed by C will add an object on the CleanupStack when it returns successfully (usually, it’s the object it returns). It’s up to the calling code to Pop that object.

    Classes prefixed by R are meant to be allocated on the stack but manage their own heap-based resources. They usually have some kind of Close() method that needs to be called before their destructor.

    A typical way to thing about the differences between a collection of objects and a collection of pointers to object is who owns the objects in the collection. Either the collection owns the objects when they are added and looses them when they are removed (and is therefore responsible for deleting each object it still contains when it is itself destroyed) or the collection doesn’t transfer ownership and something else must ensure the objects it contains will stay valid during the collection’s lifetime.

    Another way to think about collections is about how much copying of objects you want to happen when you add/get objects to/from the collection.

    Symbian descriptor and collection classes are meant to cover all these different ways of using memory and let you choose the one you need based on what you want to do.

    It’s certainly not easy to do it right but that’s how this operating system works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.