Jump to content

Recommended Posts

Posted

I'm currently trying to implement an enumerator class, but I can't seem to get it to work. Here is the code.

 

Private Class CEnumerator

*** Implements IEnumerator

Private pArr As Array

Private index As Integer

 

Public Sub New(ByVal pArr As Array)

***Me.pArr = pArr

***index = -1

End Sub ' New

Public ReadOnly Property Current() As Object Implements IEnumerator.Current

Get

***Return pArr(index)

End Get

...

...

That part keeps giving me the "disallows late binding" error.

I know I can just declare pArr as an Object array and be done with this mess, but I just want to know why can't I just return whats in*pArr(index) as an object?

 

 

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...