×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    6

    Post Beginner in Symbian app development....

    Hi,
    I want to display text of LABEL in TEXT EDITOR. For this purpose, I used the following code in LabelToEditorContainerView.cpp but it returning compilation error. Please Help.
    Code:
    TBool CLabelToEditorContainerView::HandleShowMenuItemSelectedL( TInt aCommand )
    	{
    	// TODO: implement selected event handler
    	TBuf<50> yourtext;
    		CLabelToEditorContainerView::iLabelToEditorContainer->iLabel1->GetText(yourtext);
    		CLabelToEditorContainerView::iLabelToEditorContainer->iEdit1->SetTextL(yourtext);
    	return ETrue;
    	}

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,174

    Re: Beginner in Symbian app development....

    It looks like CLabelToEditorContainerView is your view class and its container's object is iLabelToEditorContainer. If it is the case then what you are doing in
    Code:
    CLabelToEditorContainerView::iLabelToEditorContainer->iLabel1->GetText(yourtext);
    CLabelToEditorContainerView::iLabelToEditorContainer->iEdit1->SetTextL(yourtext);
    means in your view class CLabelToEditorContainerView, you already have the corresponding container's object (iLabelToEditorContainer) which you can use like
    Code:
    iLabelToEditorContainer->iLabel1->GetText(yourtext);
    iLabelToEditorContainer->iEdit1->SetTextL(yourtext);
    I am confused with your requirement. Once you set a label's text then you will always know what text you have inserted into label. So, why you are retrieving it again? In other sense, what is the purpose of setting the same text in editor which is of label.

    About your compilation error, you can always mention the compilation error while starting a thread.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    6

    Re: Beginner in Symbian app development....

    Quote Originally Posted by not_dying View Post
    It looks like CLabelToEditorContainerView is your view class and its container's object is iLabelToEditorContainer. If it is the case then what you are doing in
    Code:
    CLabelToEditorContainerView::iLabelToEditorContainer->iLabel1->GetText(yourtext);
    CLabelToEditorContainerView::iLabelToEditorContainer->iEdit1->SetTextL(yourtext);
    means in your view class CLabelToEditorContainerView, you already have the corresponding container's object (iLabelToEditorContainer) which you can use like
    Code:
    iLabelToEditorContainer->iLabel1->GetText(yourtext);
    iLabelToEditorContainer->iEdit1->SetTextL(yourtext);
    I am confused with your requirement. Once you set a label's text then you will always know what text you have inserted into label. So, why you are retrieving it again? In other sense, what is the purpose of setting the same text in editor which is of label.

    About your compilation error, you can always mention the compilation error while starting a thread.
    Hi,
    This task is my assignment. Previously, I created an application in which I displayed text of text editor in to label. My current assignment is just opposite of it.
    Now, as per you, I modified the code and removed view class but still same compilation error. The error is as following:
    error 1- undefined identifier 'GetText'
    error 2- function call '[CEikEdwin].SetTextL({lval} TBuf<50>)' does not match
    error 3- 'CEikEdwin::SetTextL(const TDesC16 *)' (non-static)

    Thanks....

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,174

    Re: Beginner in Symbian app development....

    Code:
    Now, as per you, I modified the code and removed view class
    I didn't asked you to remove view class.

    Anyway, for your 1st error: GetText() is not a CEikLabel class' function. That is why it is giving "undefined identifier".
    For your 2nd & 3rd error, if you check the documentation of CEikEdwin::SetText() then you will see that it is expecting a reference of a descriptor while you are directly passing it a descriptor. So, try to do it like
    Code:
    iLabelToEditorContainer->iEdit1->SetTextL(&yourtext);

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    6

    Re: Beginner in Symbian app development....

    Quote Originally Posted by not_dying View Post
    Code:
    Now, as per you, I modified the code and removed view class
    I didn't asked you to remove view class.

    Anyway, for your 1st error: GetText() is not a CEikLabel class' function. That is why it is giving "undefined identifier".
    For your 2nd & 3rd error, if you check the documentation of CEikEdwin::SetText() then you will see that it is expecting a reference of a descriptor while you are directly passing it a descriptor. So, try to do it like
    Code:
    iLabelToEditorContainer->iEdit1->SetTextL(&yourtext);
    Hi,
    After modifying the code as the following, there is no compilation error. But, the application is not working as I want. when I select the SHOW option, both of the editor and label shows blank.

    Code:
    TBool CLabelToEditorContainerView::HandleShowMenuItemSelectedL( TInt aCommand )
    	{
    	// TODO: implement selected event handler
    	TBuf <50> yourtext;
    		iLabelToEditorContainer->iLabel1->SetTextL(yourtext);
    		iLabelToEditorContainer->iEdit1->SetTextL(&yourtext);
    	return ETrue;
    	}

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,174

    Re: Beginner in Symbian app development....

    If your text is not visible to you (as per you said) then do check by debugging what is the content of your descriptor which you are trying to show. I guess it must be a blank string in this case.

Similar Threads

  1. Replies: 2
    Last Post: 2010-11-01, 14:08
  2. [Moved] Need Help - Beginner in Symbian Platform
    By voidmain123 in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2008-05-19, 11:17
  3. Beginner in symbian c++-Need some tips.
    By pebble_stud in forum Symbian
    Replies: 6
    Last Post: 2008-04-30, 16:20
  4. Beginner Question: Symbian 60 Bluetooth App
    By butching314 in forum Bluetooth Technology
    Replies: 1
    Last Post: 2008-01-18, 01:55
  5. Beginner questions on SMS development
    By gavinho in forum General Messaging
    Replies: 1
    Last Post: 2002-05-06, 12:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×