locked
Contact's won't show up in Contacts Application (EDB) RRS feed

  • Question

  • Hi All!

    I'm facing a problem when adding new contact items to existing pim.vol database in Windows Mobile 6.

    Here's how to reproduce my problem.

    1. I launch the Contacts application that comes with Windows Mobile 6 Standard SDK and create a new contact item and  save it to the database,
    2. The newly created contact item shows up in the contacts list as expected.
    3. Then I launch my own application to add contacts to the database. My application includes a function for saving contact information to the database, the function looks like this:

    bool Save(HANDLE database, CEGUID guid)
    {
        bool ret = false;
        CEPROPVAL prop[3];
    
        prop[2].propid = PIMPR_FIRST_NAME;
        prop[2].wLenData = 0;
        //prop[2].wFlags = CEDB_PROPNOTFOUND;
        prop[2].val.lpwstr = L"John";
    
        prop[1].propid = PIMPR_LAST_NAME;
        prop[1].wLenData = 0;
        //prop[1].wFlags = CEDB_PROPNOTFOUND;
        prop[1].val.lpwstr = L"Doe";
    
        prop[0].propid = PIMPR_FILEAS;
        prop[0].wLenData = 0;
        //prop[0].wFlags = CEDB_PROPNOTFOUND;
        prop[0].val.lpwstr = L"Doe, John";
    
        CEOID oid = CeWriteRecordProps( database, 0, 3, prop);
        
        if(oid == 0)
        {
            return false;    
        }
        
        return CeFlushDBVol(&guid);
    }


    4. The contact gets written to the database succesfully, but won't show up in the contacts lists in the Contact's application of Windows Mobile SDK.

    Do you guys have any idea why that contact won't show up in the contacts list? I have checked that the contact has been written to the database.

    However, if i replace the default pim.vol database with my own empty database, the contacts created by using my own code will appear in the Contacts application provided by Windows Mobile. So ... it seems that adding contacts to an existing database using my code won't work.

    I would appreciate any help on this issue, thank you :)

    • Edited by jpyk Monday, June 22, 2009 10:49 AM
    Monday, June 22, 2009 10:45 AM

All replies

  • Hello jpyk,

    i have one Q?

    Are you able to read records using CEReadxxxx functions.

    And i think pim API's are good enough for contact management we dont need to directly operate using CE DB api's.

    Thanks
    Arpit Pradhan
    WinCE CODER
    Friday, June 26, 2009 10:17 AM