Problem of using desktop api
Please Login to Remove!
Hi all,
I'm trying to write a desktop add-in to sync contact data between PC and BB device. But when I connect to the simulator and trace the DesktopSample code, the GetCount() function of IRimTablesPtr is always return 0. Is there anything that I have missed? Please advice, thanks!
HRESULT __stdcall CDesktopSample::raw_Process (
IRimUtility * pRimUtility,
IRimDatabaseAccess * pRimDeviceAccess )
{
try {
IRimUtilityPtr utilities = pRimUtility; //wrap in a smar pointer for ease of use
IRimProgressPtr progress = utilities; //this will throw an exception if the query fails
IRimDatabaseAccessPtr p = pRimDeviceAccess; //create a smart pointer for ease of use
IRimTablesPtr tables = p->GetTables();
//get the contacts table
IRimTablePtr contactTable;
long nTable = tables->GetCount(); // always return 0
if(!nTable)
return 0;
for(long i=1; i<=nTable; i++)
{
_bstr_t tableName = tables->GetItem(_variant_t(i))->GetName();
if(tableName == _bstr_t("Contacts"))
{
contactTable = tables->GetItem(_variant_t(i));
}
}
....
|