helpstrings

K

Kimmo Laine

Hi,

back in the COM days, i could write something like this, in IDL:

[id(1), helpstring("My Foo function")]
HRESULT Foo();

and later in (e.g.) VBs object browser, my description would apper when i
see the details for Foo.

How can i do that in C#?

[Description("My Foo function")]
public void Foo() {}

This don´t work


thx

Kimmo Laine
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

There are actually two flavours of the Description attribute. One is from
the System.ComponentModel namespace and this is most likely the one you've
tried. You can therefore try the other one residing in the
System.EnterpriseServices class.
 
K

Kimmo Laine

Hi Dmitriy,

i cannot find the EnterpriseServices namespace


Kimmo Laine

Dmitriy Lapshin said:
Hi,

There are actually two flavours of the Description attribute. One is from
the System.ComponentModel namespace and this is most likely the one you've
tried. You can therefore try the other one residing in the
System.EnterpriseServices class.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Kimmo Laine said:
Hi,

back in the COM days, i could write something like this, in IDL:

[id(1), helpstring("My Foo function")]
HRESULT Foo();

and later in (e.g.) VBs object browser, my description would apper when i
see the details for Foo.

How can i do that in C#?

[Description("My Foo function")]
public void Foo() {}

This don´t work


thx

Kimmo Laine
 
M

Morten Wennevik

Hi Kimmo,

You need to add a reference to System.EnterpriceServices.dll to be able to
use it.

(In Visual Studio .NET, In Solution Explorer, right click on References
and choose add reference. Then double click on System.EnterpriceServices
and Select OK)

Happy coding!
Morten Wennevik [C# MVP]
 
K

Kimmo Laine

Don?t work - no description in object browser

Kimmo Laine

Dmitriy Lapshin said:
Hi,

There are actually two flavours of the Description attribute. One is from
the System.ComponentModel namespace and this is most likely the one you've
tried. You can therefore try the other one residing in the
System.EnterpriseServices class.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Kimmo Laine said:
Hi,

back in the COM days, i could write something like this, in IDL:

[id(1), helpstring("My Foo function")]
HRESULT Foo();

and later in (e.g.) VBs object browser, my description would apper when i
see the details for Foo.

How can i do that in C#?

[Description("My Foo function")]
public void Foo() {}

This don´t work


thx

Kimmo Laine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top