M
Matthew Wieder
I have:
"public class B : A"
where A is an interface in a different assembly. When I precede the
class with [ClassInterface(ClassInterfaceType.AutoDual)] then there are
several methods that B implements that cannot be called from COM (once
the assembly is registered for COM, etc.). Those methods show up in the
VBA intellisense, but when I actually try to run code which calls them,
I get a "Compile Error: Function or interface marked as restricted, or
the function uses an Automation type not supported in Visual Basic."
Looking at the tlb, I see that many of the methods that cannot be called
either take or return a uint, which is transformed in the tlb as an
"unsigned long." I'm guessing that the VBA compiler is choking on that
type. Back in C#, if I change the ClassInterface to be AutoDispatch
(late binding) then everything works perfectly from VBA. However, our
requirements are that early-binding/intellisense must work from VBA, so
that won't do. I cannot change the interface A either. I was playing
with MarshalAs to see if I could tell it to use uint as something else,
but that either resulted in the method where I put the tag not showing
up at all in the tlb, or it showing up still as an unsigned long. How
can I solve this issue?
thanks!
"public class B : A"
where A is an interface in a different assembly. When I precede the
class with [ClassInterface(ClassInterfaceType.AutoDual)] then there are
several methods that B implements that cannot be called from COM (once
the assembly is registered for COM, etc.). Those methods show up in the
VBA intellisense, but when I actually try to run code which calls them,
I get a "Compile Error: Function or interface marked as restricted, or
the function uses an Automation type not supported in Visual Basic."
Looking at the tlb, I see that many of the methods that cannot be called
either take or return a uint, which is transformed in the tlb as an
"unsigned long." I'm guessing that the VBA compiler is choking on that
type. Back in C#, if I change the ClassInterface to be AutoDispatch
(late binding) then everything works perfectly from VBA. However, our
requirements are that early-binding/intellisense must work from VBA, so
that won't do. I cannot change the interface A either. I was playing
with MarshalAs to see if I could tell it to use uint as something else,
but that either resulted in the method where I put the tag not showing
up at all in the tlb, or it showing up still as an unsigned long. How
can I solve this issue?
thanks!