Question

My Outlook add-in is compiled with platform target as "Any CPU" and it works fine in 32 and 64 bit Outlook now.

I want to use redemption.dll in my add-in to extent some functionality. I saw there are two versions of DLLs in the downloaded redemption package (redemption.dll and redemption64.dll) I want to use similar code below to use the dll in my add-in

Type t = Type.GetTypeFromProgID("MyDll.MyMailItem");
SafeMailItem sItem = (SafeMailItem) Activator.CreateInstance(t);

In this case which dll I refer to my project? redemption.dll OR redemption64.dll ?

How my project loads correct DLL in 32 bit Office and 64 bit Office?

Was it helpful?

Solution

The correct dll will be loaded by the COM system, not your code.

As long as both versions are correctly installed and registered in the registry, your code will work without any modifications. Note however that you will not be able to install the 64 bit version of the dll on a 32 bit machine.

You might want to look into using RedemptionLoader - you will skip COM registration completely, and RedemptionLoader will load the right dll for you based on the process bitness.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top