Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor arun09's Avatar
    Join Date
    Feb 2009
    Posts
    287
    Hi
    I have developed the following code . In the below mentioned code ivaluebuffer has been used in the header helloworldbasicappui.h and is declared as public. i need to get the values from ivaluebuffer to msg.cpp class. I tried to get that by creating an object, but am getting a null value. Please help me to solve this




    helloworldbasicappui.cpp
    Code:
    void CHelloWorldBasicAppUi::ConstructL()
        {
    TBuf<50> avalue;
       TBuf<50> bvalue;
        avalue.Num(ivalue, numberFormat);
         	avalue.Num(ivalue1, numberFormat);
         	bvalue.Append(lbvalue);
         ivaluebuffer.Copy(avalue);
    }
    decalaration ivaluebuffer

    helloworldbasicappui.h

    Code:
    class CHelloWorldBasicAppUi : public CAknAppUi
        {
        public: // Constructors and destructor
        	    	 
        	TBuf<50> ivaluebuffer;
        	      	
            /**
            * ConstructL.
            * 2nd phase constructor.
            */
            void ConstructL();
    msg.cpp
    Code:
    CHelloWorldBasicAppUi* derived =new (ELeave) CHelloWorldBasicAppUi();
    _LIT("number","07655556")
    TRAP(error, SendSmsL(number, derived->ivaluebuffer));

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    you could get pointer to your appui from anywhere inside the application with environment variable, thus you could do something,like this to get your buffer:

    STATIC_CAST(CHelloWorldBasicAppUi *,CEikonEnv::Static()->AppUI())->ivaluebuffer;

  3. #3
    Regular Contributor arun09's Avatar
    Join Date
    Feb 2009
    Posts
    287
    Quote Originally Posted by symbianyucca View Post
    you could get pointer to your appui from anywhere inside the application with environment variable, thus you could do something,like this to get your buffer:

    STATIC_CAST(CHelloWorldBasicAppUi *,CEikonEnv::Static()->AppUI())->ivaluebuffer;
    hi,symbianyucca thanks for your reply


    this is not working in this case , I have two class CKeyCapturera and CKeyCapturer

    my requerment is pass the value of ivaluebuffer from CKeyCapturera to CKeyCapturer.please help me.

    Code:
    void CKeyCapturera::RunL()
        {
    TBuf<50> avalue;
     TBuf<50> bvalue;
     avalue.Num(ivalue, numberFormat);
     avalue.Num(ivalue1, numberFormat);
      bvalue.Append(lbvalue);
    ivaluebuffer.Copy(avalue);
    }
    another class

    Code:
    void CKeyCapturer::RunL()
    {
      _LIT(num,"9961927812");
    //STATIC_CAST(CHelloWorldBasicAppUi *,CEikonEnv::Static()->AppUI())->ivaluebuffer;
     TRAP(error, SendSmsL(num, ivaluebuffer));
    
    
    }

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    you could store it still in your appui, and maybe implement getter & setter functions, so you could read & write the values from anywhere inside your app..

Similar Threads

  1. Issue when trying to generate .sis file
    By rmulam in forum Symbian Tools & SDKs
    Replies: 9
    Last Post: 2009-08-13, 14:10
  2. Java Application running on WTK but not on S60 SDK
    By roman.benz in forum Mobile Java Tools & SDKs
    Replies: 6
    Last Post: 2009-06-09, 14:38
  3. Error Error where are u ??
    By Abhishek_karmakar in forum Symbian C++
    Replies: 14
    Last Post: 2008-10-20, 09:29
  4. External Linking Error (Undefined Symbol)
    By nile_mail in forum Symbian C++
    Replies: 2
    Last Post: 2008-08-05, 13:10
  5. Exceptions while loading application
    By avinash_rs in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 10:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved