Managed C++ methods do not appear in output

Nov 25, 2009 at 3:02 PM

I've been banging my head against this for a day or so and have tried every suggestion that I could Google/Bing but I am having absolutely no luck getting method definitions to be included in my documentation for a managed C++ interface.

I have turned on XML documentation in the C++ project and it emits the necessary xml. I have examined the xml and find the documentation information that I expect. It just does not appear in the compiled documentation. 

At this point I am about to abandon this entirely but thought that I might get some help by asking the question here directly.

I am using the Sandcastle Help File Builder 18.0.2 and the May 08, 2009 release of the Sandcastle tools.

The managed C++ contains a simple Interface declaration. There are only 4 methods. The only thing that shows up in the compiled help document is the "Structure" IEWrapper. The method definitions do not show up at all.  Other inherited members are displayed.

The source looks like:

#include "stdafx.h"
#include "TrackedEvent.h"

#define PROD_TRACK_MANAGED_API  __declspec(dllexport)
#define PROD_TRACK_MANAGED_API  __declspec(dllimport)
namespace OsmoseTrackingBridge 
///<summary>Brief Interface for posting Production Tracking events.
///<para>This class contains the exported interface methods for posting 
///Production Tracking events.</para>
public class PROD_TRACK_MANAGED_API IEventWrapper
	/// <summary>Static method to create an instance of the Event Wrapper class</summary> 
	/// <param name="pProjectName">The project name</param>
	/// <param name="pProjectTypeName">The project type name</param>
	/// <returns>IEventWrapper* </returns>

	//(implemented in EventWrapper.cpp)
    static IEventWrapper* CreateInstance(const CString& pProjectName, const CString& pProjectTypeName);

/// <summary>Static method to delete an instance of the Event Wrapper class </summary> 
/// <param name="pInstance">Pointer to the event wrapper</param>
	//(implemented in EventWrapper.cpp)
	static void Destroy(IEventWrapper *pInstance);

/// <summary>Gets the last error from the event wrapper interface.</summary>
	static CString LastError(void);

/// <summary>Add the given event to the data storage
/// <para>(pure virtual at this class - must be overridden)</para>
///	</summary>
/// <param name="pTrackedEvent">Tracked event information.</param>
/// <returns> bool - true if successful; false otherwise</returns>
	virtual bool AddEvent(const TrackedEvent& pTrackedEvent) = 0;
Nov 25, 2009 at 8:30 PM
Edited Nov 25, 2009 at 8:30 PM

If you have a small sample project file and code that you can e-mail me so that I can build it and try it out, I'll take a look at it.  My e-mail address is in the Sandcastle Help File Builder GUI's About Box and the footer of the pages in the SHFB help file.  I tried using a modified version of the code above but it wouldn't compile and my C++ skills aren't what they used to be.



Dec 3, 2009 at 2:42 AM

In case anyone else runs into this issue, here's what I found:

The assembly generated either doesn't contain metadata for the class's members or it isn't in a format that can be read or interpreted by Sandcastle and other such tools.  Because of that, the members don't show up in the output from the MRefBuilder tool.  I see similar behavior when examining the resulting assembly with either Reflector or ILDASM.  The class itself is there but when you expand it, it has no members.  I'm not sure what would cause that issue and whether it is by design or a bug in the C++ compiler.  I do see some odd classes that appear to have been injected by the compiler concerning a missing __ATL_MIXED definition and/or one with a different value.  I'm not sure why they are there and if that is contributing to the issue.  If there is a way and you can figure out how to get the compiler to output the necessary info, it should work.  Unfortunately, I don't know enough about the C++ compiler to offer any suggestions.


Dec 3, 2009 at 11:57 AM

I appreciate your effort for looking into this Eric.

Is there a microsoft forum that you know about where I might take your discovery to see if I can get an explanation?


Dec 3, 2009 at 8:44 PM

I'd suggest the Visual C++ MSDN forum as a starting point: