"Any CPU" question

My app is a VSTO Outlook add-in and supports both 32- and 64-bit versions of Outlook; consequently it needs to be compiled as Any CPU, not x86. What should I do in this case in terms of using LimeLM and TurboActivate? Thanks!

Hey Phil,

The way to handle "Any CPU" is to modify the TurboActivate.cs file to handle this. So copy and paste the internal "Native" class, and name the copied version "Native64". In the "Naitve64" copy you can delete the "ACTIVATE_OPTIONS", "GenuineFlags", and "GENUINE_OPTIONS" because those will be the same whether you're using the 32-bit or 64-bit versions of TurboActivate.

Then modify the function definition of every static extern in Native64. For instance change the dll name from TurboActivate.dll to "TurboActivate64.dll".

The last step is to modify the actual function calls so the correct DLL is called based on whether your plugin is running in a 64-bit process or a 32-bit process. For example, the top of Activate will look like this:

public static void Activate(){    switch (IntPtr.Size == 8 ? Native64.Activate() : Native.Activate())    {        case 2: // ...

If you want to wait until the end of the day I'll put together a version of TurboActivate.cs with all the changes made already.

>> If you want to wait until the end of the day I'll put together a version of TurboActivate.cs with all the changes made already. <<

That would be awesome, Wyatt! One request, though - I'm actually using VB.NET, so could you provide a TurboActivate.vb instead or in addition?

Sure, I'll do that.