Custom Types in TLB

M

Matthew Wieder

We have classB in projectB which implements interfaceA from projectA.
Some of the methods that are implemented take or return enums or classes
also defined in projectA. When we export projectB (marked as AutoDual)
using tlbexp and then consume it from VBA, the VBA compiler (and
intellisense) chokes on any of the functions that take or return any of
the custom enums/classes. If we include the definitions of those
enums/types in projectB, then everything is fine from the VBA. However,
since classC in projectC which also implements interfaceA is used in
classB (that would be intA->classB; intA->classC; classC->classB)
combining classB with projectA's contents into a single project
(projectA) results in a circular reference (since then projectA would
need projectC to be built first since it uses classC, but classC needs
projectA to be built first since it contains the interface).
So, I need a way to include the enums/classes from projectA with classB
in the same dll so that tlbexp consumed by VBA works properly, but to
not have a circular reference issue.
If anyone followed that, can they help?
thanks!
 
N

Nicholas Paldino [.NET/C# MVP]

Matthew,

You can not do what you are trying to do.

Basically, you should reference project A from projects B and C. When
using them in VB, you will have to set a reference to project A whenever you
use project B and project C.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top