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-n 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?
Edited byjack_jjWednesday, August 28, 2013 7:16 PMmispelled CPU as CP
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 bale 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.