Commenting windows API calls

Topics: Developer Forum, User Forum
Feb 11, 2008 at 6:51 PM

I've defined a method that uses a call to a Windows API function. I set the documentation tags for the Windows API function, but it seems that the compiler ignores the comments before the <DLLImport> attribute or I am missing something. A example of the comments follow below:

''' <summary>
''' The summary of the function
''' </summary>
''' <param name="pszPath">First param.</param>
''' <param name="dwFileAttributes">Second param.</param>
''' <param name="psfi">Third param</param>
''' <param name="cbFileInfo">Fourth param</param>
''' <param name="uFlags">Fifth param.</param>
''' <returns>Describes the return of the function.</returns>
''' <remarks>Version 4.0 recommended.</remarks>
#End Region
<DllImport("Shell32.dll")> _
Private Shared Function _
SHGetFileInfo(ByVal pszPath As String, ByVal dwFileAttributes As Integer, ByRef psfi As SHFILEINFO, ByVal cbFileInfo As Integer, ByVal uFlags As SHGFI) As Integer
End Function

The function appears on the help file (VS2005 style), but all the comments are ignored. I set SHFB to document privates. Do I need to configure something more for this to work?

Feb 11, 2008 at 7:19 PM
Check the XML comments file. Do you see the comments in it? If not, then the compiler isn't outputting them for some reason. There is an "#End Region" tag between the comments and the declaration in your example. Is that interfering with it? I copied your example and pasted it into a test class and the comments came out okay in the help file. You might force a full rebuild of your VB project just be sure that the comments really got written to the comments file.

Feb 12, 2008 at 3:31 PM
Hi Eric.

There was a typo in my original comments. SHFB was ignoring the comments because of that.