Symbian:在s60第3版上从SIM获取联系人

时间:2012-06-12 10:55:09

标签: symbian

以下是计算存储在SIM卡上的联系人数量的代码。当我编译它时,我得到错误,表明应该包含用于RBasicGsmPhone的lib。我用Google搜索了lott并发现需要gsmbas.lib,但mmp文件建议中没有这样的lib文件。该怎么办??有人请帮忙

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);     

1 个答案:

答案 0 :(得分:0)

有些图书馆实际上并非公开,必须从诺基亚获取。您可以尝试联系诺基亚关于此主题的Symbian支持 - 如果它们仍有任何内容。