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?
Stepped over the trap of initializing the loader in the main Thread and calling methods in another...
来源:https://stackoverflow.com/questions/47810856/outlook-redemption-using-redemptionloader-without-regsvr32-the-dll