It is not a bug in the function definition, but there is a wrapper function missing. Use the following code to read the names from NI-CAN instead.
Function nct_GetNames(ByVal FilePath As String, ByVal Mode As Long, ByVal MessageName As String, ByVal BufferSize As Long, ByRef List As String)
' This function wraps nctGetNames function and makes the names from NI-CAN available for the
' user in string format
Dim str() As Byte
Dim i As Integer
Dim Status As Long
ReDim str(BufferSize + 1)
i = 1
nct_GetNames = nctGetNames(FilePath, Mode, MessageName, BufferSize, str(0))
List = Chr(str(0))
While ((i < BufferSize) And (Chr(str(i)) <> "\0"))
List = List + Chr(str(i))
i = i + 1
Wend
End Function
Call this function instead of nctGetNames directly.