2010-03-10 91 views
4

我已經有了一些C++/CLI軟件,它們都很好,並以C#形式記錄,這意味着DOxygen能夠將它拉出到一些不錯的html中。有沒有什麼辦法可以讓我的相同信息出現在intellisense工具中,就像.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; 
    } 

這裏就是智能感知爲在建當我打字功能: http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense1.jpg

這裏就是智能感知爲我自己的功能,當我鍵入: http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense2.jpg

肯定有辦法做到這一點?

+2

由SO問題回答「記錄C++/CLI庫代碼以便在c#中使用 - 最佳工具和實踐?」:http://stackoverflow.com/questions/1040479/documenting-c-cli-library-code-for -use-from-c-best-tools-and-practices/1071967#1071967 – 2010-03-10 01:31:46

+0

完美 - 不知道爲什麼我在搜索時沒有發現: - / – 2010-03-10 09:07:16

回答

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 FilesYes

當您重建項目廣告時將其導入其他地方,應該會看到完整記錄的工具提示。

相關問題