Outlook Redemption - using RedemptionLoader without regsvr32 the DLL

醉酒当歌 提交于 2019-12-04 06:14:25

问题


I want to use the mail functions without registering the COM dll (regsvr32). I followed the informations from:

http://www.dimastr.com/redemption/security.htm#redemptionloader

so i initialize the dll with

private Redemption.SafeMailItem safeMail = Redemption.RedemptionLoader.new_SafeMailItem();

which shows the Eval-Popup. All good. But when i assign the outlook mail item to the object

 safeMail.Item = mail; // of type Microsoft.Office.Interop.Outlook.MailItem

then this exception appears:

Unable to cast COM object of type 'System.__ComObject' to interface type 'Redemption.ISafeMailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0A95BE2D-1543-46BE-AD6D-18653034BF87}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

After registering the dll with regsvr32 it works? But i dont want that.

What am i doing wrong?

EDIT:

  • i tried it with registering the COM on the dev machine
  • removing the COM and use the Interop.Redemption.dll

What it the intended way of using the Loader without registering the COM?


回答1:


Stepped over the trap of initializing the loader in the main Thread and calling methods in another...

see Redemption + Clickonce = :-(



来源:https://stackoverflow.com/questions/47810856/outlook-redemption-using-redemptionloader-without-regsvr32-the-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!