COM Classes Exceptions
It looks like the interface created by .Net for COM classes does not seem to conform to the FxCop rules. Here are some of the exceptions I am getting for the simple class below:
Error, Certainty 95, forIdentifiersShouldNotContainUnderscores
"Remove all underscores from type '_ProverLinkEventArgs'."
Error, Certainty 95, forIdentifiersShouldHaveCorrectPrefix
"Prefix interface name '_ProverLinkEventArgs' with 'I'."
CriticalError, Certainty 95, forIdentifiersShouldNotHaveIncorrectSuffix NestedTypesShouldNotBeVisible
"Rename 'isr.IO.Provers.ProverLinkEventArgs+_ProverLinkEventArgs' so that it does not end in 'EventArgs'."
Do not nest type 'isr.IO.Provers.ProverLinkEventArgs+_ProverLinkEventArgs'
Any idea for how to get around these exceptions?David <ComClass(ProverLinkEventArgs.ClassId, ProverLinkEventArgs.InterfaceId, ProverLinkEventArgs.EventsId),System.Runtime.InteropServices.ProgId("isr.IO.Provers.ProverLinkEventArgs"),Serializable(), System.Runtime.InteropServices.ComVisible(True)>PublicClass ProverLinkEventArgs Inherits System.EventArgs #Region " COM GUID Values " ' These GUID values provide the COM identity for this class #EndRegion #Region " Constructors and Destructors " ''' <summary>Constructs this class.</summary> ''' <summary>Construct event arguments for the calling prover link with #EndRegion #Region " Properties " Private _statusMessageAsString EndClass
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
PublicConst ClassIdAsString = "EBE49BA8-0440-4DD0-91AC-B1CE1DBE9F95"
PublicConst InterfaceIdAsString = "F7F21C4D-3115-4E92-882C-73CDEE1BB60F"
PublicConst EventsIdAsString = "8AACE1E6-B45C-4409-BDBB-B09A66D0A325"
''' <summary>Because this class is COM Creatable, we provide a default constructoreven though this is unlikely to be used.</summary>
'''--
PublicSubNew()
MyBase.New()
EndSub
''' <param name="sendingProverLink">A reference to the sending
''' prover link.</param>
''' <remarks>Use this constructor to instantiate this class and specify the event message, type and id.</remarks>
'''--
PublicSubNew(ByVal sendingProverLinkAs ProverLink)
' instantiate the base class
MyBase.New()
' now set the member properties.
_sendingProverLink = sendingProverLink
EndSub
''' a specific message.</summary>
''' <param name="sendingProverLink">A reference to the sending prover link.</param>
'''--
PublicSubNew(ByVal sendingProverLinkAs ProverLink,ByVal messageAsString)
' instantiate the base class
MyBase.New()
' now set the member properties.
_sendingProverLink = sendingProverLink
_statusMessage = message
EndSub
Private _sendingProverLinkAs ProverLink
''' <summary>This property specifies a reference to the sending prover link.</summary>
''' <value><c>SendingProverLink</c> is a ProverLink property.</value>
'''--
<System.Runtime.InteropServices.ComVisible(True)>PublicProperty SendingProverLink()As ProverLink
Get
Return _sendingProverLink
EndGet
Set(ByVal valueAs ProverLink)
_sendingProverLink = value
EndSet
EndProperty
''' <summary>Holds the status message of the event arguments.</summary>
''' <value><c>StatusMessage</c> is a ProverLink property.</value>
'''--
<System.Runtime.InteropServices.ComVisible(True)>PublicProperty StatusMessage()AsString
Get
Return _statusMessage
EndGet
Set(ByVal valueAsString)
_statusMessage = value
EndSet
EndProperty
#EndRegion

