views:

136

answers:

1

Hey all, I am currently porting a legacy VBA application to a .Net application. During this process the users of the existing VBA application need to have some features added. So instead of coding them in VBA & then later in C#, I’ve wrote the new functionality in C# and I want to expose this to the existing VBA application through COM, as well as also keeping it in the currently .Net application version.

The solution contain several projects, 1 project for the UI, 1 project for Business Logic, 1 project for the data access layer.

The new features are just a some new forms to modify data. So ideally they will click on a form command button in access which lunch these C# forms via COM interop.

How should I go about exposing this forms through COM Interop. What I was hoping to do was just add another project, MyProject.COM, which will contain my Interface ICOMManager, for exposing methods to access to launch the required forms. My COMManager class will just instantiate the required forms in my .net application and show them. This project MyProject.COM will have references to the UI layer & Business Logic Layers.

When I want to register this project using REGASM how will I include references to these other projects?

Thanks for any help or advice on how about doing this.

+2  A: 

Ah ok so i see this is alot easier than i thought.

Once i looked at the reg file produced by regasm i could see that the tlb (Type Library) is just a pointer to where it can find the libraries to execute the .Net component.

So once i register the tlb and make sure its pointed to the install directory where the rest of the project files are located it works.

Cypher