If I then instance two copies of this object from a separate VB application (for example)
' "mycall" is an entry point in mycpp.dll Private Declare Function mymath Lib "mycpp.dll" Alias "mymath" (ByVal info As String) _ As Long ' the public version to access that library Public Function doMath(ByVal info As String) As Long doMath = mymath(info) End Function ' and a property... Private myInternalProp As String Public Property Let someProp(value As String) myInternalProp= value End Property Public Property Get someProp() As String someProp = myInternalProp End Property
The "someProp" value is clearly separate between the two objects, but the doMath is calling the SAME instance of the DLL (the DLL saves some values and I can tell from the output of "domath" that it is the same call)
Dim obj1 As myTools.application Dim obj2 As myTools.application Set obj1 = New myTools.application Set obj2 = New myTools.application obj1.someProp = "first instance" MsgBox(obj2.someProp) 'shows empty, thus unique copy of "application" result1 = obj1.doMath("...") result2 = obj2.doMath("") 'result2 shows that this called into the same DLL
From novice to tech pro — start learning today.