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

  • SEARCH
  • Home
  • 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 6201575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:34:47+00:00 2026-05-24T04:34:47+00:00

Recently, I am studying Symbian development. When I want to use CDirectScreenAccess to draw

  • 0

Recently, I am studying Symbian development. When I want to use CDirectScreenAccess to draw on the device directly, there occurs the question.
My code is below :

//MySnakeAppView.h
class CMySnakeAppView : public CCoeControl
{
...
private:
void ConstructL(const TRect& aRect);
CDirectScreenAccess* iDSA;
void Restart(RDirectScreenAccess::TTerminationReasons aReason);
void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
void DrawGraphics();
...
}

//MySnakeAppView.cpp

void CMySnakeAppView::ConstructL(const TRect& aRect)
    {
// Create a window for this application view
CreateWindowL();

// Set the windows size
SetRect(aRect);

// Activate the window, which makes it ready to be drawn
ActivateL();


CEikonEnv* env = CEikonEnv::Static();
iDSA = CDirectScreenAccess::NewL(env->WsSession(), *env->ScreenDevice(), Window(), *this);

iDSA->StartL();
DrawGraphics();
}
void CMySnakeAppView::DrawGraphics()
    {
CFbsBitGc *gc = iDSA->Gc();
TRgb colorRed = AKN_LAF_COLOR(35);
gc->SetPenColor(colorRed);
gc->DrawRect(TRect(0,0,100,100));
iDSA->ScreenDevice()->Update();

}
void CMySnakeAppView::Restart(RDirectScreenAccess::TTerminationReasons aReason)
    {

    iDSA->StartL();
    DrawGraphics();
    } 
void CMySnakeAppView::AbortNow(RDirectScreenAccess::TTerminationReasons aReason)
    {

    iDSA->Cancel();
    }

when I build this project, it is wrong with the code
iDSA = CDirectScreenAccess::NewL(env->WsSession(), *env->ScreenDevice(), Window(), *this);
this is a mistake writing that :
‘MDirectScreenAccess &’
– illegal implicit conversion from
‘CMySnakeAppView’ to
but when I do it like this :
iDSA = CDirectScreenAccess::NewL(env->WsSession(), *env->ScreenDevice(), Window(), (MDirectScreenAccess &)*this);

there is no mistake in building,but still have mistake in the project, I don’t know why,I need your help

  • 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-24T04:34:49+00:00Added an answer on May 24, 2026 at 4:34 am

    Your CMySnakeAppView should derive from MDirectScreenAccess – it looks like you’re already implementing the right methods, you’re just missing the declaration:

    class CMySnakeAppView : public CCoeControl, public MDirectScreenAccess
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently start studying JAVA, and I find this code: public class Dublicate{ public
I've just recently been studying JQuery to use on a personal website. Something I
recently, while reading former's code in my current project, I encounter the problems below:
Maybe some might find this, a hypothetical question. I have recently started development of
I was studying some code I found on the web recently, and came across
I've recently been studying TDD, attended a conference and have dabbled in few tests
I have recently started studying about threads. I thought of starting from the beginning
I began studying Java Regular Expression recently and I found some really intersting task.For
Recently I've spotted a very disturbing issue. I've got the following python code: for
I was recently studying C# where i came across following for loop // Display

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.