如何获得完整的intellisense工具提示评论工作?

时间:2010-03-10 01:12:50

标签: documentation c++-cli intellisense doxygen

我有一些C ++ / CLI软件,这些软件都很好用C#记录的方式,这意味着DOxygen可以把它拉成一些漂亮的HTML。有没有什么方法可以让我在智能感知工具中出现相同的信息提示.net框架的方式呢?

例如,假设这是我的头文件(MyApp.h):

    /*************** MyApp.h ***************/

    /// My namespace containing all my funky classes
    namespace MyNamespace
    {
            using namespace System;

            ref class WorldHunger;

            /// A truly elegent class which solves all the worlds problems
            public ref class MyClass
            {
            public:
                    /// Constructs a MyClass
                    MyClass()
                    {

                    }


                    /// <summary>Attempts to fix world hunger</summary>
                    /// <param name="problem">The problem to try and fix</param>
                    /// <returns>Whether or not the problem was solved</param>
                    bool FixWorldHunger( WorldHunger^ problem );
            };
    }

......这就是相应的实现:

    /*************** MyApp.cpp ***************/

    #include "MyApp.h"

    using namespace MyNamespace;

    MyClass::MyClass()
    {

    }

    bool MyClass::FixWorldHunger( WorldHunger^ problem )
    {
            bool result = false;

            /// TODO: implement something clever

            return result;
    }

以下是intellisense在我输入内容时对内置函数的作用: http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense1.jpg

当我输入时,以下是intellisense对我自己的函数的作用: http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense2.jpg

当然有办法做到这一点吗?

1 个答案:

答案 0 :(得分:7)

总而言之,为了实现这一目标,您需要以兼容的形式提出意见:

/// <summary>
/// Retrieves the widget at the specified index
/// </summary>
/// <param name="widgetIndex">Index of the widget to retrieve.</param>
/// <returns>The widget at the specified index</returns>
Widget* GetWidget(int widgetIndex);

然后,您只需右键单击Visual Studio中的项目,然后转到properties > configuration properties > C/C++ > Output Files并将Generate XML Documentation Files更改为Yes

当您重建项目时,广告会将其导入其他地方,您应该会看到完整记录的工具提示。

相关问题