Fix inlined member calls, on user objects on 64-bit VBA
In 64-bit VBA hosts, inlined member calls on user objects don't work like on 32-bit VBA hosts.
Given a UserClass with a getter/setter and a Class_Terminate handler (even it is empty).
And in a TestModule a factory procedure returning an instance of this class and also setting the setter.
When I now use this procedure and inline check the value of the getter like in the following sample, it results in a different behaviour compared to 32-bit VBA:
If CreateUserClass(True).TheValue Then
Please take a look in the attached text file for a complete sample:
Private mValue As Boolean
Private Sub Class_Terminate()
Public Property Get TheValue() As Boolean
TheValue = mValue
Public Property Let TheValue(ByVal value As Boolean)
mValue = value
Public Function CreateUserClass(ByVal value As Boolean) As UserClass
Set CreateUserClass = New UserClass
CreateUserClass.TheValue = value
Public Sub ShortTest()
Const VALUE_TO_TEST As Boolean = True
Debug.Print "Value to check: " & VALUE_TO_TEST
If Not CreateUserClass(VALUE_TO_TEST).TheValue Then
Debug.Print "This is wrong"
Debug.Print "This would be correct"