suhas joyous

suhas joyous

  • NA
  • 3
  • 14.9k

expose IList member to VB through COM

Nov 20 2010 3:55 AM
hi,
i am new to this forum, so please bare me if i mistake.
i have to develop application API in .Net such that it can be used through VB, and off cause this can be done with COM wrapper.

I am stuck at one place. i have a class which is collection of some class.
like
public class A()
{
}

public Class B<T> : C
{

}

public Class C<T> : List<T>
{

}

now here B is collection class. and i want to expose methods of List to COM (VB) user.
so i have used class B like this by derived from ILIST

[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
[GuidAttribute("6caf3f96-2a46-4321-865e-4aca9ed0399f")]
Class B<T> : C<T>, IList
{
   
}

i applied all steps for make this assembly available in VB 6.
registered this assembly and generated tlb file and use its reference in VB 6.0 application.

by thinking that IList is ComVisible(true) so it can shows me methods of IList in VB6.0
but it can not show any methods of IList in VB 6.0 application.

All other methods of other class is available except class B

Can some one suggest me how can i implement IList in .net such that its methods are available in VB 6.0 application through COM.

thanks,
Regard,
Joyous Suhas

Answers (1)