سؤال

We have a managed C++ Adobe Reader plugin specifically designed for Reader X / XI. It works fine in Windows 7, but on Windows XP it throws a COM error - Class not registered.

What's strange is that this only happened after we updated the project from a vs2005 project to vs2010. The old vs2005 plugin works just fine. Anyone have any clue as to why that would be? We just used the standard project auto-upgrade when we moved to 2010. All the rest of the code is the same.

Edit: some more notes about the issue

The plugin DLL itself loaded just fine. It was only when we tried to load a .Net 4 dll through COM interop that we experienced the exception.

Previously, the dll that we were trying to load was written in .net 2.0, and that loads just fine in Windows XP. But the .Net 4 dll will only load in Win7. Note that .Net 3.5 seems to work just like 2.0. It's only .net 4 that breaks (we recompiled the exact same code to 2.0, 3.5, and 4.0 to check).

هل كانت مفيدة؟

المحلول

Turns out the problem is a combination of Adobe's Protected Mode and trying to load a .Net 4 DLL through COM interop, but only on Windows XP.

Bizarrely... change any of those variables, and everything works fine. .Net 3.5 and 2.0 both load fine with Protected Mode on. Windows 7 loads the .Net 4 dll fine with Protected Mode on.

Turning off Protected Mode in Adobe for Windows XP fixes the problem so the DLL loads fine.

I hope this helps someone else who runs into this.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top