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. Thanks for all your past and future contributions.

Archived:Incorrect drawing area returned by CAknView::ClientRect() in S60 2nd Edition (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Issue applies to out of scope platform versions.

In some situations, the drawing area returned by CAknView::ClientRect() is incorrect on the S60 2nd Edition.

Article Metadata
Platform(s): S60 2nd Edition and FP1, FP2, FP3
S60 2nd Edition (initial release)
Created: User:Technical writer 1 (22 Nov 2006)
Last edited: hamishwillee (24 Apr 2013)


CAknView implements its own version of the ClientRect() function, which is normally used when setting the size of the container control(s) maintained by the view. In some cases, the height of the rectangle returned by CAknView::ClientRect() is incorrect; this happens when there are both an application-level CBA as well as a view-specific CBA defined in the resource file.

The end result is that the area occupied by the control pane is subtracted twice from the application drawing rectangle, and the height of the rectangle returned by CAknView::ClientRect() is too small.

How to reproduce

This can be easily reproduced with the 'multiviews' example application from S60 2nd Edition, FP3 SDK.

In multiviews.rss, add a CBA definition in the EIK_APP_INFO resource


Then recompile and run the example.


This issue can be solved by designing the view-based application so that it does not need a CBA defined in EIK_APP_INFO resource (eg., replace it with a CBA from the 'main' view).

Another option is to pass a reference to the AppUi when constructing the view(s), and replace the CAknView::ClientRect() calls with CEikAppUi::ClientRect() calls in the views' implementation.

This page was last modified on 24 April 2013, at 00:45.
25 page views in the last 30 days.