Although an assembly can be created visible to COM, one should follow below guidelines to ensure that things work as planned:
csc /t:library ComVisiblePerson.cs
Next you need to use Type Library Exporter Utility. This should be done from VS command prompt:
tlbexp ComVisiblePerson.dll /out:ComVisiblePersonlib.tlb
Next oyu need to create resource script (ComVisiblePerson.res) with the following Interface Definition Language (IDL) definition:
IDR_TYPELIB1 typelib "ComVisiblePersonlib.tlb"
then you recompile the application with the new resource file added as:
csc /t:library ComVisiblePerson.cs /win32res:ComVisiblePerson.res
- All classes must use a default constructor with no parameters.
- Any type that is to be exposed must be public.
- Any member that is to be exposed should be public.
- Abstract classes will not be able to be consumed.
csc /t:library ComVisiblePerson.cs
Next you need to use Type Library Exporter Utility. This should be done from VS command prompt:
tlbexp ComVisiblePerson.dll /out:ComVisiblePersonlib.tlb
Next oyu need to create resource script (ComVisiblePerson.res) with the following Interface Definition Language (IDL) definition:
IDR_TYPELIB1 typelib "ComVisiblePersonlib.tlb"
then you recompile the application with the new resource file added as:
csc /t:library ComVisiblePerson.cs /win32res:ComVisiblePerson.res
Comments
Post a Comment