Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Couldn't resolve default property of object Me.

Couldn't resolve default property of object Me.

Scheduled Pinned Locked Moved Visual Basic
questioncsharphelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AR Reddy
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • A 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

      N Offline
      N Offline
      nishkarsh_k
      wrote on last edited by
      #2

      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

      A D 2 Replies Last reply
      0
      • N nishkarsh_k

        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

        A Offline
        A Offline
        AR Reddy
        wrote on last edited by
        #3

        Thanks, Ill try it out.

        AR Reddy

        1 Reply Last reply
        0
        • N nishkarsh_k

          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

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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, 2008

          modified on Monday, June 30, 2008 12:37 PM

          A 1 Reply Last reply
          0
          • D Dave Kreskowiak

            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, 2008

            modified on Monday, June 30, 2008 12:37 PM

            A Offline
            A Offline
            AR Reddy
            wrote on last edited by
            #5

            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

            D 1 Reply Last reply
            0
            • A 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

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Under VB.NET, there is no default property for the Me object. You have to specifically tell the compiler which property of Me 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

              A 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Under VB.NET, there is no default property for the Me object. You have to specifically tell the compiler which property of Me 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

                A Offline
                A Offline
                AR Reddy
                wrote on last edited by
                #7

                Thanks a lot

                AR Reddy

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups