الجمعة، 17 فبراير 2012

How to add helpstring in tlb generate from VB.NET or C# class

In IDL you can have a helpstring attribute that adds descriptions to your interfaces.
To be able to generated those helpstring tags in a VB.NET  class you should use the Description tag

For example see this example taken from:http://stackoverflow.com/questions/6668500/getting-the-helpstring-attribute-applied-to-c-sharp-properties-exposed-via-com-i

using System; using System.ComponentModel; using System.Runtime.InteropServices;    namespace ClassLibrary1 {     [ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsDual)]     public interface IFoo {         int property {             [Description("prop")]             get;             [Description("prop")]             set;         }     } }  

NOTE: remenber that in some cases you have to apply the description attribute to both get and set.

ADITIONAL NODE:

After some test, I found that there are some differences with the helpstring behaviour in VB.NET. For example the helpstring attribute is not generated for methods. More on C#/VB.NET Interop Differences http://mheironimus.blogspot.com/2006/10/vbnet-com-interface-issues.html

Source: http://blogs.artinsoft.net/Mrojas/archive/2012/01/25/How-to-add-helpstring-in-tlb-generate-from-VBNET-or-C-class.aspx

asp.net datagrid how to learn asp.net how to learn asp.net quickly how to deploy asp.net application asp.net ajax asp.net repeater how to send email from asp.net how to program how to programming how to make a program

ليست هناك تعليقات:

إرسال تعليق