Why are Auto-properties are not exposed to Com?

  • Thread starter Thread starter LeonardH
  • Start date Start date
L

LeonardH

Guest
I am converting an old VB6 com library to DotNet, but until the main application is converted, plan to use the new DotNet version in (a new version of) the original VB6 application. While I would like to convert as many as possible of the generic properties of the various classes to auto-properties, after compiling a test, the auto-implemented properties are not exposed to com. I'm not sure if this is a bug or a "feature". Can someone explain?

For example:

<ComClass("9E72255F-37E8-4ecd-AB8E-9DA309D0A3E1")>
Public Class clsPerson

Public Property Name As String

Private _Phone As String
Public Property Phone As String
Get
Return _Phone
End Get
Set(value As String)
_Phone = value
End Set
End Property
End Class



When compiled, only the Phone property shows up in the VB6 object browser.

Thanks




Leonard Hampton

Continue reading...
 
Back
Top