I'm writing a VBScript to read through the repository using the Object Repository Utility API. The code goes something like this:

Dim obj
Set obj = GetObjectFromRep(NULL, "Admin")

Function GetObjectFromRep(objParent, objectName)

Dim objChildCollection
Dim objRep, index

Set objRep = CreateObject("Mercury.ObjectRepositoryUtil")

objRep.Load("C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\Default.tsr")

Set objChildCollection = objRep.GetChildren(objParent)

MsgBox "count : " & objChildCollection.Count
For index = 0 To objChildCollection.Count-1
If objRep.GetLogicalName(objChildCollection.Item(inde x)) = objectName Then
Set GetObjectFromRep = objChildCollection.Item(index)
Exit For
End If

MsgBox GetObjectFromRep.GetTOProperty("micClass")

'Set objChildCollection = Nothing
'Set objRep = Nothing
End Function

At the end of the function call I'm getting the pure virtual function call error. Any idea what could be causing this error?