BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-03-2007, 11:18 PM   #1
eddie129
New Member
 
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Don't know
Posts: 3
Default 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));
}
}
....
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Serta Big and Tall Commercial Office Chair Memory Foam 350 Lb Capacity Black NEW picture

Serta Big and Tall Commercial Office Chair Memory Foam 350 Lb Capacity Black NEW

$169.99



New In Box SIEMENS 6ES7954-8LF03-0AA0 6ES7 954-8LF03-0AA0 Memory Card picture

New In Box SIEMENS 6ES7954-8LF03-0AA0 6ES7 954-8LF03-0AA0 Memory Card

$246.08



Nightingale CXO 6200 Memory Foam, New Headrest, Lumbar Support Ergo Office Chair picture

Nightingale CXO 6200 Memory Foam, New Headrest, Lumbar Support Ergo Office Chair

$415.00



New Sealed AB 2080-MEMBAK-RTC Memory Backup, Data Log, Recipe ,High Accuracy RTC picture

New Sealed AB 2080-MEMBAK-RTC Memory Backup, Data Log, Recipe ,High Accuracy RTC

$292.51



Schneider Electric | Memory Card | TSXMRPP224K | TSX MRPP224K | NEW | Sealed picture

Schneider Electric | Memory Card | TSXMRPP224K | TSX MRPP224K | NEW | Sealed

$271.45



Avnet UltraZed-EG AES-ZU3EG-1-SOM-I-G Zynq UltraScale+ MPSoC System-on-Module picture

Avnet UltraZed-EG AES-ZU3EG-1-SOM-I-G Zynq UltraScale+ MPSoC System-on-Module

$129.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.