我正在尝试将“Nothing”传递给Vb.NET中的参数(使用VS 2010将所有内容都设置为默认值)
代码是这样的:
Public Property status As statusEvidenta
<DebuggerNonUserCode()> _
Get
Me.m_status = Nothing
Me.m_status = MyForms.Create__Instance__(Of statusEvidenta)(Nothing)
其中:
Public m_status As statusEvidenta
和:
Private Shared Function Create__Instance__(Of T As {System.Windows.Forms.Form, New})(ByRef Instance As T) As T
Dim v_genericMethodVar As T
If ((Not Instance Is Nothing) AndAlso Not Instance.IsDisposed) Then
Return Instance
End If
我不熟悉VB.NET,但为什么我不能只传递Nothing参数?在c ++中你可以传递一个NULL,这在这里不可能吗?
我收到以下错误:
附加信息:未将对象引用设置为对象的实例。