I finally got it to work! Here is a simple example. First create an Active-X DLL in Visual Basic with the following for the Class Module:
Public Function Create() As Variant
Dim loCollection As New Collection
loCollection.Add "One", "String"
loCollection.Add "1", "Character"
loCollection.Add 1, "Integer"
loCollection.Add #1/1/98#, "Date"
loCollection.Add 1.12, "Float"
Set Create = loCollection
End Function
Under the projects properties, name the project Test and the Class Module Tools. Afterwards, compile to a DLL.
In Visual FoxPro, do the following:
oTest = CREATEOBJECT("Test.Tools")
oCollection = loTest.Create()
? oTest.Count && Returns 5
? oCollection.Item(1) && Returns "One"
? oCollection.Item("String") && Returns "One"
= oCollection.Add(DATETIME(), "Time") && Adds current date and time
= oCollection.Remove(1) && Removes key "One"
? oCollection.Item(1) && Returns 1
Thanks for your help!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only