C# – Registering 32-bit DLL on 64 bit system

ccomvisual studio

I am working with some test code to create Visio documents. I am using Visual Studio 2010 on Window 7 64 bit. When I run my program and attempt to create the new Visio application object in the program I get thie following exception:

Retrieving the COM class factory for component with CLSID {00021A20-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Here's the code that causes the exception:

Visio.Application va = new Microsoft.Office.Interop.Visio.Application();

I verified the project settings are to build a 32-bit application. I have tracked it back to 64-bit Windows can't load the 32-bit .COM Visio dll. I tried registering the dll using regsvr32 but get an error message that the entry-point DLLregisterserver was not found. MDSN says this means the file is not a valid .dll. Nowever I am trying to register the Microsoft.Office.Interop.Visio.dll from the Visual Studio libraries. Is there a fix for this? Is there a 64-bit version of the .COM libraries?

Best Answer

Follow this link. This page explains how to install dlls as on 32 bit system, though you are using 64 bit system

You can find 32-bit version of REGSVR32 on 64 bit system on path-- %systemroot%\SysWoW64\regsvr32.exe.

WoW = stands for Windows on Windows

Related Topic