×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    27

    Function call doesn`t work in ConstructL() but at other places it works fine, why?

    Hi, I wrote a programm, which should get the IMEI at startup. I implement the IMEI-program from the WIKI.
    When I call the IMEI-function in the UI-constructor my program give me on a device the error message: Program closed.
    On the 3rd edition emulator the program works fine and it works also fine at devices with 2nd edition sdk. Only at devices with 3rd edition it doesn`t work.
    I use a developer certificate with all available capabilities.

    Have anyone some suggestions or an explanation? I`m really confused, why it doesn`t work in the constructL() at 3rd edition.

  2. #2
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Function call doesn`t work in ConstructL() but at other places it works fine, why?

    There could be several things.. try posting a snippet, and let us know the specific error (panic) you're getting. Search the forum for explanations to achieve this.

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: Function call doesn`t work in ConstructL() but at other places it works fine, why?

    BTW, which IMEI reading code are you using ?

    As far as know the CTelephony does not work with 2nd edition (or maybe I have never tried), but has worked just fine with me when constructed in Appui's ConctructL function.

    yucca

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    27

    Re: Function call doesn`t work in ConstructL() but at other places it works fine, why

    I use the Imei-Function, which get the imei synchronously.
    This is the cpp-file:
    Code:
    #include "SMSExampleValidate.h"
     
    void CGetImei::GetIMEI(TDes& aIMEI)
    {
    	CGetImei* self= new (ELeave) CGetImei(aIMEI);
    	CleanupStack::PushL(self);
      	self->ConstructL();
    	CleanupStack::PopAndDestroy(self);
    }
     
    void CGetImei::ConstructL()
    {
            //if( iStatus =! KRequestPending )
    	//{	
            iTelephony = CTelephony::NewL();
    	CActiveScheduler::Add(this);	
    	CTelephony::TPhoneIdV1Pckg iPhoneIdV1Pckg(iPhoneIdV1);
    	iTelephony->GetPhoneId(iStatus, iPhoneIdV1Pckg);
    	SetActive();
    	CActiveScheduler::Start();
            //}
    }
     
    CGetImei:: CGetImei(TDes& imei): CActive(EPriorityStandard),IMEI(imei)
    {
        //default constructor
    }
     
    CGetImei::~CGetImei()
    {
        delete iTelephony;
        iTelephony = NULL;
        
        Cancel();
    }
     
    void CGetImei::RunL()
    {
        if(iStatus==KErrNone)
        {
    	IMEI= iPhoneIdV1.iSerialNumber;
    	CActiveScheduler::Stop();
        }
    }
     
    void CGetImei::DoCancel()
    {
        iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
    }
    I think my code is right, because I get it from the Wiki and at other places in my program it works fine. Only in the ConstructL() from the UI it doesn`t work. I suppose that something is wrong with other active functions. I tested under the above ConstructL() the if-loop with KRequestPending. With the loop my program starts, but didn`t read the IMEI.

    I don´t know, what I can further do?
    Have you some ideas?

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: Function call doesn`t work in ConstructL() but at other places it works fine, why

    Basically, if you would just take the code as it is given in the Wiki it would work. I personally wrote that and tested it, and it doesn't re-assemble your code really...Thus make it easy for your self and copy paste the code from the Wiki without modifications....

    yucca

Similar Threads

  1. Replies: 2
    Last Post: 2004-04-27, 10:36
  2. CommConnection does not work with Series 60 SDK, but works in JWT
    By jackiechan2001 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-02-04, 09:07
  3. Replies: 3
    Last Post: 2004-01-28, 23:15
  4. Replies: 2
    Last Post: 2003-07-09, 13:50
  5. does irda function work with the emulator ?
    By IGhost in forum Symbian
    Replies: 0
    Last Post: 2002-12-07, 17:43

Posting Permissions

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