-
Notifications
You must be signed in to change notification settings - Fork 302
Adding a new Host Application to Rubberduck
Rubberduck needs the Primary Interop Assemblies to run Unit-Tests. As such these Assemblies (also shortened to PIAs) are necessary for only the Unit-Testing feature.
To run the Unit-Tests Rubberduck accesses the Application.Run
method, calling the tests by their name.
For other Hosts than Office the names of the method may differ. This means we need a way to call into these PIAs.
For that we should first have a PIA. This means we'll generate ourselves one.
The linked msdn article goes into detail, but in short you'll run the following command:
tlbimp HostAppCOM.tlb /out:HostApp.Interop.dll
Before we can use the PIA now we need to reference it in Rubberduck. When you open the Rubberduck Solution in Visual Studio you will see something along the following:
You'll usually just have to right-click and use add after dropping the generated PIA in the libs directory
The next step is the last one (it's basically two steps in one, but eh). You need to implement
a new IHostApplication
by extending HostApplicationBase
. The only remaining step to be done here is to give the HostApplication it's name and specify how Rubberduck can call things through the PIA.
Finally you need to add a case for your application in the HostApplicationExtensions
, the same way all other cases work:
case "YourApplication":
return new YourApplicationApp();
rubberduckvba.com
© 2014-2021 Rubberduck project contributors
- Contributing
- Build process
- Version bump
- Architecture Overview
- IoC Container
- Parser State
- The Parsing Process
- How to view parse tree
- UI Design Guidelines
- Strategies for managing COM object lifetime and release
- COM Registration
- Internal Codebase Analysis
- Projects & Workflow
- Adding other Host Applications
- Inspections XML-Doc
-
VBE Events