Couldn't resolve default property of object Me.
-
Hi, I am new to VB and VB.NET. My Application is upgraded from VB6 to VB.NET. But I got some problems as "Couldn't resolve default property of object Me.". How Can I resolve these kind of warnings. Here is my code: Private ReadOnly Property IParameter_LeseLaenge() As Integer Implements _IParameter.LeseLaenge Get 'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' Return I_IParameter(Me).laenge End Get End Property //I_IParameter method is: Public Function I_IParameter(ByRef obj As _IParameter) As _IParameter I_IParameter = obj End Function One More: Public WriteOnly Property SelButton() As System.Windows.Forms.Button Set(ByVal Value As System.Windows.Forms.Button) mSelBtn = Value If mParent.IsAlive Then 'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' Parent.AddCtrl(mSelBtn, Me) End If End Set End Property //AddCtrl method: Public Sub AddCtrl(ByVal ctrl As System.Windows.Forms.Control, ByVal descriptor As _IFieldDescriptor) 'UPGRADE_ISSUE: ObjPtr function is not supported. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1040"' mCtrls.Add(descriptor, CStr(ObjPtr(ctrl))) End Sub Could any one of you please let me the solution? Thanks in Advance.
AR Reddy
-
Hi, I am new to VB and VB.NET. My Application is upgraded from VB6 to VB.NET. But I got some problems as "Couldn't resolve default property of object Me.". How Can I resolve these kind of warnings. Here is my code: Private ReadOnly Property IParameter_LeseLaenge() As Integer Implements _IParameter.LeseLaenge Get 'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' Return I_IParameter(Me).laenge End Get End Property //I_IParameter method is: Public Function I_IParameter(ByRef obj As _IParameter) As _IParameter I_IParameter = obj End Function One More: Public WriteOnly Property SelButton() As System.Windows.Forms.Button Set(ByVal Value As System.Windows.Forms.Button) mSelBtn = Value If mParent.IsAlive Then 'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' Parent.AddCtrl(mSelBtn, Me) End If End Set End Property //AddCtrl method: Public Sub AddCtrl(ByVal ctrl As System.Windows.Forms.Control, ByVal descriptor As _IFieldDescriptor) 'UPGRADE_ISSUE: ObjPtr function is not supported. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1040"' mCtrls.Add(descriptor, CStr(ObjPtr(ctrl))) End Sub Could any one of you please let me the solution? Thanks in Advance.
AR Reddy
In vb.net Me always refers to the current form... I think if u look ur code with this information u can find the issue
-
In vb.net Me always refers to the current form... I think if u look ur code with this information u can find the issue
-
In vb.net Me always refers to the current form... I think if u look ur code with this information u can find the issue
nishkarsh_k wrote:
In vb.net Me always refers to the current form
Wrong, but I can see why you'd think this is true.
Me
always refers to the current instance of the class in which it is used. Since a Form is nothing but a class,Me
works just like it is used in any other class code.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008modified on Monday, June 30, 2008 12:37 PM
-
nishkarsh_k wrote:
In vb.net Me always refers to the current form
Wrong, but I can see why you'd think this is true.
Me
always refers to the current instance of the class in which it is used. Since a Form is nothing but a class,Me
works just like it is used in any other class code.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008modified on Monday, June 30, 2008 12:37 PM
Hi thanks for the reply, I am not able to get this. In VB6.0, passing a parameter as "ME", (means type is current class if I am not wrong). When we convert it to VB.NET this parameter is converting as ME only but waring message " Couldn't resolve default property of object Me." coming. Here is the sample code. VB6 code: Private Property Get IParameter_SchreibLaenge() As Long IParameter_SchreibLaenge = I_IParameter(Me).laenge End Property VB.NET Code: Private ReadOnly Property IParameter_SchreibLaenge() As Integer Implements _IParameter.SchreibLaenge Get 'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' Return I_IParameter(Me).laenge End Get End Property Note: This is nto giving any compilation error. But Its giving runtime error. When we run it, its giving some cast error. Please help me out. I am really struggling for this to get. Thanks in Advance,
AR Reddy
-
Hi thanks for the reply, I am not able to get this. In VB6.0, passing a parameter as "ME", (means type is current class if I am not wrong). When we convert it to VB.NET this parameter is converting as ME only but waring message " Couldn't resolve default property of object Me." coming. Here is the sample code. VB6 code: Private Property Get IParameter_SchreibLaenge() As Long IParameter_SchreibLaenge = I_IParameter(Me).laenge End Property VB.NET Code: Private ReadOnly Property IParameter_SchreibLaenge() As Integer Implements _IParameter.SchreibLaenge Get 'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' Return I_IParameter(Me).laenge End Get End Property Note: This is nto giving any compilation error. But Its giving runtime error. When we run it, its giving some cast error. Please help me out. I am really struggling for this to get. Thanks in Advance,
AR Reddy
Under VB.NET, there is no default property for the
Me
object. You have to specifically tell the compiler which property ofMe
you are referring to.Private ReadOnly Property IParameter_SchreibLaenge() As Integer Implements _IParameter.SchreibLaenge
Get
'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Return I_IParameter(Me_.whichProperty_).laenge
End Get
End Property[A guide to posting questions on CodeProject](http://www.codeproject.com/scrapbook/ForumGuidelines.asp)\[[^](http://www.codeproject.com/scrapbook/ForumGuidelines.asp "New Window")\]
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
2006, 2007, 2008 -
Under VB.NET, there is no default property for the
Me
object. You have to specifically tell the compiler which property ofMe
you are referring to.Private ReadOnly Property IParameter_SchreibLaenge() As Integer Implements _IParameter.SchreibLaenge
Get
'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Return I_IParameter(Me_.whichProperty_).laenge
End Get
End Property[A guide to posting questions on CodeProject](http://www.codeproject.com/scrapbook/ForumGuidelines.asp)\[[^](http://www.codeproject.com/scrapbook/ForumGuidelines.asp "New Window")\]
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
2006, 2007, 2008