Incremental Change Synchronization - redemption dll

W

WLAN

Hi,

I'm trying to get SynchData using redemption dll interfaces. But sometimes
it is throwing the following error:

Unable to cast COM object of type 'Redemption.RDOFolderClass' to interface
type 'Redemption.IRDOFolder2'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{4A34CF03-DB62-4D32-829A-B0079E16E28C}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).

What is the issue? and How do I solve this problem?
 
D

Dmitry Streblechenko

Where does the folder come from?
Please show the relevant snippet of your code.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
W

WLAN

I'm invoking this synch from an outlook addin. I have override
namespace_optionspageadd event handler of Outlook.

The following is the code snippet

private void m_namespace_OptionsPagesAdd(PropertyPages pages, MAPIFolder
mapiFolder)
{

//

string synchData =
getSynchData(mapiFolder.Name,mapiFolder.EntryID,mapiFolder.StoreID);

}

private string getSynchdata(string,string,string)
{
//Outlook namespace
NameSpace nms = outlookApp.GetNamespace("MAPI");

//Folder Synch Mechanism
Redemption.RDOSession rdoSession = new
Redemption.RDOSessionClass();
rdoSession.MAPIOBJECT = nms.MAPIOBJECT;

string strSQLRestriction = "MessageClass = 'IPM.Note'";
//retrieve the folder to be synchronized
Redemption.IRDOFolder2 rdoFolder2 =
((Redemption.IRDOFolder2)rdoSession.GetFolderFromID(folderEntry,storeID,

Redemption.rdoFlagIcon.olNoFlagIcon));
if (rdoFolder2 != null)
{

//first synchronization
Redemption.RDOFolderSynchronizer synchronizer =
rdoFolder2.ExchangeSynchonizer;

if (synchronizer != null)
{
//previous synch data
Redemption.RDOSyncMessagesCollection syncItems =
synchronizer.SyncItems(strSyncData, strSQLRestriction);

//if valid
if (syncItems != null)
{
//enumerate all items returned
//foreach (Redemption.RDOSyncMessageItem item in
syncItems)
//{
// MessageBox.Show(item.Item.Subject);
//}

//remember/store the sync cookie
strSyncData = syncItems.SyncData;
}}
}
 
D

Dmitry Streblechenko

Looks perfectyly fine to me.
Does it always happen for the same folder?
Once it happens, does it keep happing for all the folders?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
W

WLAN

Hi,

This is happening to all folders. But earlier it was working and i used to
do ICS mechanism using the same code.

any idea, what would be the problem?

thanks
 
W

WLAN

Hi,

I found the issue. Somehow an older version of redemption dll was registered
and i re-register 4.6.0.924 version of redemption dll.

Now its working...

Thanks Dmitry
 
W

WLAN

Hi,

Do I need to call Marshal.ReleaseComObject() function for the following
objects:

rdoSession,rdoFolder2,syncItems ,synchronizer etc.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top