|
-
May 7th, 2003, 09:23 AM
#1
Thread Starter
I wonder how many charact
Possible to get around this late binding?
I have a class which holds a collection of objects defined by another class.
The collection class is ManufacturerCollection
The object class is Manufacturer
In the ManufacturerCollection class... I am trying to get around late-binding this method, but don't see a way how:
VB Code:
Public Function GetManufName(ByVal index As Integer) As String
Return InnerList.Item(index).Name
End Function
This function returns the name of the manufacturer object listed at that index inside the ManufacturerCollection object.
I can get it to work with Option Strict Off, but with it on, I get a late-bounding warning... I would prefer not to do late-binding, but I'm not sure if its even possible to get around it.
-
May 7th, 2003, 09:32 AM
#2
Lively Member
not sure if i'm barking up the wrong tree but can't you do...
Code:
Public Function GetManufName(ByVal index As Integer) As String
Dim m as Manufacturer = CType(InnerList.Item(index), Manufacturer)
Return m.Name
End Function
-
May 7th, 2003, 09:35 AM
#3
Thread Starter
I wonder how many charact
Thanks Shutty, you nailed it! I actually had written the code like that earlier in a different class, but never noticed it.... mornings...
Last edited by nemaroller; May 7th, 2003 at 09:46 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|