We have a few related products based off the same code base which have VBA integrated in it. We have split our object models into a few pieces, so that each product has two type libraries - common and app-specific. The common type library is the same for each product, while app-specific one has the methods/classes specific to that product. This way, we can have a plug-in created that would work with all the products (using their common functionality by referencing the common type library) as well as product-specific plug-ins that would use the app type library.
Now we are trying to see what would it take to integrate VSTA into our products. However we have a problem right at the stage of generating the proxy. Trying to run ProxyGen with command line like this:
proxygen.exe /l:"app.tlb" /c:"proxy.cs" /o:"descriptor.xml"
produces the following error:
An unrecoverable error was encountered during processing.
Object reference not set to an instance of an object.
This may have been caused by earlier errors.
There is something generated in descriptor.xml but it doesn't have all the types declared in the type library.
Just to give you some more background info on our type library structure. As I said earlier, each product has two type libraries: "common.tlb" and "app.tlb"
Common tlb has just the common interfaces of features available to all application SKUs based on the product platform.
e.g.
library CoreLib
{
[uuid(...)]
interface ICoreApplication : IDispatch
{
HRESULT Visible([in] VARIANT_BOOL newVal);
}
}
The application type library includes the core interfaces as well as defines application-specific classes and methods:
library AppLib
{
importlib "common.tlb"
[uuid(...)]
interafce IApplication : IDispatch
{
HRESULT Visible([in] VARIANT_BOOL newVal);
HRESULT SomeAppSpecificMethod();
}
[appobject, uuid(...)]
coclass Application
{
[default] interface IApplication;
interface ICoreApplication;
}
}
So, when a plugin is created it can either choose to use IApplication interface to use all the features of the particular product, or ICoreApplication which is shared between all the products, making the plug-in work with any product based off the code platform.
I have both app.tlb and common.tlb registered on the dev machine, yet I have this error occuring which prevents us from further investigating VSTA integration...
Any suggestions?