I have a fully featured comment provider written in C++. I would like to use it as a custom provider with DoxyComment. I do not know how to write the build a comment methods so each return a C# dynamic string array string[] which is not compatible with C++. Would I have to write a small C# library that must provide the interface to DoxyComment? My provider greatly extends the functionality of DoxyComment and I would rather not port the entire code to C#.
Thanks for any input,
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I assume you are using managed C++ to implement the comment provider. Managed C++ does support .NET - the following code defines a function that returns a string array:
String* GetArray() []
{
String *rv[] = new String *[5];
Troels,
Thanks for the response. I am new to VS .NET so I am unsure if the default project I created was managed code and I do not know how to tell. However, I typed in the method you suggest and the compiler responded with "error C2090 function returns array". The help file suggests returning a pointer instead. All I'm trying to do is write CreateClassComment and accept and receive the appropriate parameters but I can't seem to find the right object. Everything referenced in the TestProvider such as String and the vcCodeElement stuff is met by a "can't use this class without a top-level^". I fear I might be in over my head because I have no idea what any of this means. Perhaps I should just go back to my C++ add-in. It works great but does not have any toolbar buttons or property pages. Any my team has already accepted and blessed it.
But, anyway, thanks for your help. I don't think I have the expertise to write this custom provider in C++ or port my code to C#(shudder).
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a fully featured comment provider written in C++. I would like to use it as a custom provider with DoxyComment. I do not know how to write the build a comment methods so each return a C# dynamic string array string[] which is not compatible with C++. Would I have to write a small C# library that must provide the interface to DoxyComment? My provider greatly extends the functionality of DoxyComment and I would rather not port the entire code to C#.
Thanks for any input,
Joe
Hi Greybeard,
I assume you are using managed C++ to implement the comment provider. Managed C++ does support .NET - the following code defines a function that returns a string array:
String* GetArray() []
{
String *rv[] = new String *[5];
rv[0] = "Test1";
rv[1] = "Test2";
rv[2] = "Test3";
rv[3] = "Test4";
rv[4] = "Test5";
return rv;
}
Check this article on .NET arrays in managed C++: http://www.codeproject.com/managedcpp/csarrays01.asp
Troels,
Thanks for the response. I am new to VS .NET so I am unsure if the default project I created was managed code and I do not know how to tell. However, I typed in the method you suggest and the compiler responded with "error C2090 function returns array". The help file suggests returning a pointer instead. All I'm trying to do is write CreateClassComment and accept and receive the appropriate parameters but I can't seem to find the right object. Everything referenced in the TestProvider such as String and the vcCodeElement stuff is met by a "can't use this class without a top-level^". I fear I might be in over my head because I have no idea what any of this means. Perhaps I should just go back to my C++ add-in. It works great but does not have any toolbar buttons or property pages. Any my team has already accepted and blessed it.
But, anyway, thanks for your help. I don't think I have the expertise to write this custom provider in C++ or port my code to C#(shudder).
Joe