Udostępnij za pośrednictwem


COM Interop - C# type consumed by VB6 program - Part 2. Still searching...

If I define the type in C# as a public class instead of as a struct, I still get a compile error on the same line as before in VB6.  This time the error message is: “Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions”.

Cool.  Not.

Comments

  • Anonymous
    August 03, 2003
    user defined types in VB are not something related to COM, but are a VB thing. THe error clearly states that the user defined type is stored inside a variant, it is not used as a com object.