I have a simple problem, but I can't solve it even with the Internet... I don't know what is wrong.
I defined a variable:
Dim paczka(1) As SenditAPI.singleSizesData
singleSizesData is a structure and I need an array of this structure
And then I try:
paczka(0).width = 10
paczka(0).height = 10
paczka(0).depth = 10
paczka(0).weight = 4
paczka(0).COD = 0
paczka(0).INS = 5
paczka(0).content = "Test"
I get the "An unhandled exception of type 'System.NullReferenceException'" error. I really don't know why.
singleSizesDatais an array structure. @PradeepKumar I get that error in this line -paczka(0).width = 10singleSizesDatais not a structure but a class. This is because strucures don't need to be initialized, while classes do need initialization (using the new keyword). You can verify this by initializing it likepaczka(0) = New SenditAPI.singleSizesDatabefore that line. If it works, then surely it is a Class, and not a Structure. Please verify.