Results 1 to 3 of 3

Thread: Member not found!!?? - NewEnum

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242

    Member not found!!?? - NewEnum

    Hi,

    Here is the scenario:

    I have a library called GXDErrorHandler, which has a collection that supports enumeration through For...Each.

    Then I have another library called GXDCore, which has an object that "implements" GXDErrorHandler.Errors (the collection).

    So, VB shows all the methods of GXDErrH.Errors in GXDCore.Errors for me to implement, including the NewEnum function:

    Code:
    Private Function Errors_NewEnum() As stdole.IUnknown
    
        Errors_NewEnum = gerrxErrors.NewEnum
    
    End Function
    gerrxErrors is a global object variable of type GXDErrH.Errors

    But when I try to compile GXDCore (or a start with full compile), I get this error in Errors_NewEnum:

    Code:
    Compile error:
    
    Member or data member not found
    Can anyone help this poor soul?

    Thanks in advance.

  2. #2
    Member
    Join Date
    Feb 2001
    Location
    Greensboro, NC.
    Posts
    40
    You will need to use brackets around the reference to your private collection's NewEnum property(or function).

    Additionally, You must use the set command for this to work.

    Here is an example:

    Code:
    Private Property Get IAttributes_NewEnum() As stdole.IUnknown
        Set IAttributes_NewEnum = mCol.[_NewEnum]
    End Property
    Hope this helps!
    Regards.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242
    Thanks a lot!

    I don't know how I forgot the "Set"... Although I don't need to use [_NewEnum] because that gives me the same error, so I just added Set and it now works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width