Article ID: 184898
Article Last Modified on 5/13/2003
-or-
Dim oMyObject as Object
Dim MyUDT as Object
Set oMyObject = CreateObject("MyProject.MyClass")
MyUDT = oMyObject.MyMethod '<-- This line generates a run-time error
' if MyMethod returns a UDT.
Public Type MyUDT
x as Long
y as Long
End Type
Public Function MyMethod() as MyUDT
MyMethod.x = 1
MyMethod.y = 2
End Function
Private Type MyUDT
x as Long
y as Long
End Type
Private Sub Command1_Click()
Dim obj1 as Object
Dim obj2 as Object
Set obj1 = CreateObject("TestServer.Class1")
obj2 = obj1.MyMethod '<== Generates run-time error #429.
End Sub
Private Sub Command2_Click()
Dim obj1 as Object
Dim mu as MyUDT
Set obj1 = CreateObject("TestServer.Class1")
mu = obj1.MyMethod '<== Generates compile error.
End Sub
Additional query words: kbVBp kbdsd kbDSupport kbVBp600 kbActiveX kbDSupport kbDSD
Keywords: kbnofix kbprb KB184898