Sign in to follow this  
karwosts

VC++ 2010 Express, XML Comments and Intellisense

Recommended Posts

karwosts    840
I've been looking to add a bit of documentation to my project, and trying to see if there's any way to get any helpful information out of intellisense. I read up a little bit about XML documentation, and found the switch to have VC++ generate the .xml file when the code is compiled. I saw this bit in the [url="http://msdn.microsoft.com/en-us/library/ms177226(v=vs.80).aspx"]MSDN[/url]which has made me curious:

[quote]
In Visual C++, you can add comments to your source code that will be processed to an .xml file. This file can then be the input to a process that creates documentation for the classes in your code. [b]An .xml file can also be used to support IntelliSense on your component.[/b][/quote]

Does this bold sentence mean anything in layman's terms? I've tried searching around and I get mixed messages everywhere, to some people saying intellisense can load the .xml if it is the same name as the generated .exe, and others saying it won't do anything without a plugin (unavailable to Express versions).

I did a simple test with a tiny bit of code:
[code]
class GfxDevice {
///<summary>
///GetD3DDevice:
/// Returns the d3d9 device
///</summary>
LPDIRECT3DDEVICE9 GetD3DDevice();

};
[/code]

and compiled it to see if I got anything interesting, but I'm pretty underwhelmed.

Hovering over the function (GetD3DDevice) doesn't display any of the comment, and if I type

[code]
GfxDevice gfxDev;
gfxDev.GetD3DDevice
[/code]

and pause there, it gives me this popup:
[quote]
public GfxDevice::GetD3DDevice
<summary>
GetD3DDevice:
Returns the d3d9 device
</summary>
File GfxDevice.h
[/quote]

which obviously isn't really doing anything with the xml tags, it just spits out the comment that precedes the function. Is there any way to get better documentation/popup help from visual studio, or should I just resign myself to the fact that it won't ever display any documentation on tooltip hover (which is probably when I would like it the most).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this