Access Violatio when adressing the Scripting.Dictionary object
I got a dll using the Dictionary object to store public types with nested
types of a class.
When I assign
var = mDicScriptStep.Item(Line)
I get an access violation "Memory could not be read"
I've been working a lot with the dictonary object before but
I never observed this strange behavior.
Does anybody observe anything similar?
Best regards
Volker
###########################
Project:
Type=OleDll
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
ThreadingModel=1
DebugStartupOption=0
#########################
Code (in a class):
Private mDicScriptStep As Dictionary
Private mDicStepName As Dictionary
[..]
Public Enum ValueTypeConstants
vtcEmpty = 0
vtcVoltage = 1
vtcCurrent = 2
vtcOther = 3
End Enum
Public Type ScriptValueType
ValueType As ValueTypeConstants
Value As Single
Description As String
End Type
Public Type ScriptStepType
Line As Long
Values(0 To MAX_COLS - 1) As ScriptValueType
End Type
[...]
Private Sub Class_Initialize()
Set mDicScriptStep = New Dictionary
Set mDicStepName = New Dictionary
End Sub
Private Sub Class_Terminate()
Set mDicScriptStep = Nothing
Set mDicStepName = Nothing
End Sub
Public Function GetScriptStep(Line As Long) As ScriptStepType
Dim var As ScriptStepType
If mDicScriptStep.Exists(Line) Then
var = mDicScriptStep.Item(Line)
<-- after executing this line I get an access violation
GetScriptStep = var
End If
End Function