Object and Property Descriptions

I am making a managed dll in C++ to use in later projects for C++, VB, and C#.

When ever you click on properties of MS user controls in the design portion IDE it tells you what that property is, ect. I would like to know how describe properties in the same manner. Also when you look at an object in the object browser it gives you a summary; I would also like to know how to define these summaries in C++.

Thanks in advance for any help

[472 byte] By [NeederOfVBHelp] at [2007-12-23]
# 1
These

are generated by attribute classes in the System.ComponentModel

namespace. They are only relevant to designable components.

The important ones:

- BrowseableAttribute, makes property visible in the property window

- CategoryAttribute, names the property category

- DescriptionAttribute, sets the description for property or event

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 2

thank you,

I know it would be written as shown in C#:

[DescriptionAttribute ("MyDescription")]

But how would I do it in managed C++?

NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 3
[Description("MyDescription")] in C++/CLI, I'd be surprised if it was different in MC++.

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 4

Ok, apparantly you can't forget to add a refrence if you don't want a compile error

I got it working, but I don't think the description attribute is the one I'm looking for, I want the one that describes it in that little inteli sense box that pops up when you are typing the property or method.

NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 5
I

didn't think so. Hmm, it should be automagic. IntelliSense

is supposed to pick it up from the reference you add to the

project. Then again, IS tends to be a bit InonS when you don't

build your project once a while. C++ doesn't have the "background

compiler" that works so well in VB.NET, kinda works in C# and doesn't

work at all in C++. Are you just looking for the IS annotation

that shows you the arguments or are you looking for more info on the

method?

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 6

well compiling isn't the the problem, I rebuild every time I make a change; although I am building it in C++, I am testing it with C#. Basically if I decide to distribute the dll I making, I want people to know how to use the properties and methods, because as you know, appropriate names are never enough plus I want the stuff I make to look professional

It's not an component so I need the descriptions to be veiwed in intelisense or and the object veiwer only.

NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 7
The summary description of classes and members that you see in the Object Browser are generated from the XML documentation comments in your source code.
nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 8

ok, got the summary code working kinda but it says in the documentation it's supposed to generate .xdc but I couldn't find any, I even did a search for *.xdc, but found nothing except one file related to Adobe Acrobat

I used the /doc switch, mabey I'm forgetting some sort of refrence?

NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 9
It generates an .xml file, you'll find it in the project's Debug folder.

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 10
cant find the xml either
NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 11
Maybe VCE doesn't support it. Check your build log, my last line reads:

"Creating command line xdcmake.exe /blabla".

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 12

hmmm, don't see any thing about xdcmake, mabey you are right about VC++E not supporting it; but mabey I am doing some thing wrong, mabey I didn't make all the nessary refrences? maybey I didn't write the switch right, is the following correct?

/clr:pure

/doc

Heres a sample property just incase:

///<summary>"Determines whether or not the tool outputs text to its associated control."</summary>

static property bool OutputActivityStrs

{

bool get()

{

return OutputActStrs;

}

void set(bool value)

{

OutputActStrs=value;

}

}

NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 13
You're doing everything right. xdcmake.exe is in the VC\bin folder in my prof edition.

nobugz at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 14
ok it's there in myn aswell, how do I use it to get the xml out?
NeederOfVBHelp at 2007-8-30 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...