Hi, I believe this is a tough one...
I'm trying to create a collection of variable binding in a class.
It is intended to look something like this:
Dim x as integer, s as string
Dim c as new VBindClass
x = 1
s = "Hello"
c.Add x, s
Debug.Print c.value(x) '= 1
Debug.Print c.value(s) '= "Hello"
Is there some function that allow us to retrieve a unique ID for a given variable and also get/set based on variable?
Update:
At last, I've managed to found the answer. Here's the code:
Dim gh As Runtime.InteropServices.GCHandle = Runtime.InteropServices.GCHandle.Alloc(obj)
Return Runtime.InteropServices.GCHandle.ToIntPtr(gh).ToInt64