|
-
Jun 15th, 2005, 10:16 AM
#1
Thread Starter
Addicted Member
Problems getting custom object into a custom collection [Resolved]
I have a class called objLocate which stores information about various searches my program performs. I also have a custom class that works like a collection. Both of the classes work correctly because I have gotten my save previous searches to work correctly. I am trying to create a list box now loaded with some standard features that will be linked to the custom collection class I created by referecing the object through the item property.
I am getting the error
Additional information: Object reference not set to an instance of an object
on the line
Dim tempObject As objLocate = New objLocate(SearchFor.RegularExpression, desMachineType.HomeWorkstation, "MA-EA.*", enumSaveName.DellTag, enumSearchTab.Basic, enumUpdateHashTable.No)
I have tried as new objLocate as well and I even tried the like that is commented out which is a function i created to create these objects from the class. I keep getting the same error.
VB Code:
lstDivisions.Items.Add("MA-EA")
Dim tempObject As objLocate = New objLocate(SearchFor.RegularExpression, desMachineType.HomeWorkstation, "MA-EA.*", enumSaveName.DellTag, enumSearchTab.Basic, enumUpdateHashTable.No)
'Dim tempObject As objLocate = LoadLookingForObject(enumSearchTab.Basic, enumPresetSearch.GX110)
preDivision.Add(tempObject)
tempObject = Nothing
lstDivisions.Items.Add("MA-FI")
Dim tempObject1 As New objLocate(SearchFor.RegularExpression, desMachineType.HomeWorkstation, "MA-FI.*", enumSaveName.DellTag, enumSearchTab.Basic, enumUpdateHashTable.No)
preDivision.Add(tempObject1)
Last edited by Porsche944; Jun 15th, 2005 at 02:18 PM.
-
Jun 15th, 2005, 10:26 AM
#2
Re: Problems getting custom object into a custom collection
Do all parameter are enumeration ? or are they all instanciated ?
Code:
SearchFor.RegularExpression
desMachineType.HomeWorkstation
enumSaveName.DellTag
enumSearchTab.Basic enumUpdateHashTable.No
or probably the error is in the New Event of objLocate?
-
Jun 15th, 2005, 11:25 AM
#3
Thread Starter
Addicted Member
Re: Problems getting custom object into a custom collection
They are enumerations, I've never had problems creating objLocate objects from this class before.
The error actually happens on this line
preDivision.Add(tempObject)
-
Jun 15th, 2005, 11:50 AM
#4
Re: Problems getting custom object into a custom collection
and what is the definition of preDivision?
Do it is Instantiated earlier ?
-
Jun 15th, 2005, 02:16 PM
#5
Thread Starter
Addicted Member
Re: Problems getting custom object into a custom collection
Thanks for that response I found the problem was in the way I declared preDivision I forgot to ad as new on it. It's working now thats for your help.
I am adding props to your replies.
-
Jun 15th, 2005, 02:17 PM
#6
Thread Starter
Addicted Member
Re: Problems getting custom object into a custom collection
"You must spread some Reputation around before giving it to Zakary again."
Looks like I already gave you props for helping me out on something else. I'll get you back in the future
-
Jun 15th, 2005, 03:01 PM
#7
Re: Problems getting custom object into a custom collection [Resolved]
Happy to help body !!
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
|