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 over the next few weeks. Thanks for all your past and future contributions.

Active Object Pitfalls

From Wiki
Jump to: navigation, search
Article Metadata
Created: Den123 (26 Jun 2007)
Last edited: hamishwillee (02 Feb 2012)

A stray-event panic from the Active Scheduler ( E32USER-CBASE 46 error ) is a most common problem with an Active Objects. This is ussually caused by one ( or more ) of the following:

  • You forgot to call CActiveScheduler::Add() before starting the Active Object.
  • You dont call SetActive() after issuing an async request.
  • Passing the same iStatus to two service providers at the same time ( multiple requests outstanding on the same Active Object ).

Do not invoke DoCancel() directly - it should be private - always call Cancel(). Note that Cancel() should be always be called in the destructor of your derived class.

Other related pitfalls (triggering other panics):

  • Using your own TRequestStatus variable, instead of using the one provided by CActive.
  • Passing automatic variables when doing an asynchronous request.

Careless use of active objects can degrade the response time of UI in case of:

  • Priority of active object is higher than it is necessary
  • Method RunL() works too long
This page was last modified on 2 February 2012, at 05:14.
99 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.