0

Here is the code that counts number of contacts stored on SIM card. When I compile it, I get error showing that lib for usage of RBasicGsmPhone should be included. I googled a lott and found that gsmbas.lib is needed,but there is no such lib file in mmp file suggestions. What to do?? Someone pls help

TInt SimCntCount = 0;

    /*this code is just to get the TSY name*/
    CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeUnspecified); 

    CleanupStack::PushL(db); 

    CCommsDbTableView* table = db->OpenTableLC(TPtrC(MODEM)); 

    table->GotoFirstRecord(); 

    table->ReadTextL(TPtrC(MODEM_TSY_NAME),iTsyName); 

    // Cleanup - CommsDB no longer needed 
    CleanupStack::PopAndDestroy(2); // table,db 

    // Connect to the ETel server 
    RTelServer aTelServer; 

    User::LeaveIfError(aTelServer.Connect()); 

    CleanupClosePushL(aTelServer); 

    User::LeaveIfError(aTelServer.LoadPhoneModule(iTsyName)); 

    TInt numberOfPhones; 

    User::LeaveIfError(aTelServer.EnumeratePhones(numberOfPhones)); 

    SimCntCount = 0;

    for (TInt i=numberOfPhones; i>0; i--) { 
        // Get the phone name 
        RTelServer::TPhoneInfo phoneInfo; 

        User::LeaveIfError(aTelServer.GetPhoneInfo(i-1,phoneInfo)); 

        // Open the phone by name 
        RBasicGsmPhone phone; 

        User::LeaveIfError(phone.Open(aTelServer,phoneInfo.iName)); 

        TInt phoneBookCount;

        phone.EnumeratePhoneBooks(phoneBookCount);

        RBasicGsmPhone::TPhoneBookInfo aPbInfo;

        for(TInt j=0;j<phoneBookCount;j++){
            phone.GetPhoneBookInfo(j,aPbInfo);

            SimCntCount += aPbInfo.iUsed;
        }
        phone.Close();
    } 
    CleanupStack::PopAndDestroy(1);     
Simon Gates
  • 23
  • 1
  • 1
  • 11

1 Answers1

0

Some libraries are actually not public and must be obtained from Nokia. You can try to contact Nokia's Symbian support about this topic - if they still have any interes in it.

Riho
  • 4,523
  • 3
  • 33
  • 48