#unique on
uses oleaut
function Foo () as string2
dim b as bstr = SysAllocString("Test string")
return b
end function
dim s as string2 = Foo
print s
print s prints the numeric value of the returned bstr pointer, not the content of the string. Shouldn't the bstr pointer be attached to the returned string?
I'm using this Foo function to demonstrate the problem. In normal O2 code I will return a string2, but there re many COM methods that return a bstr and declaring the return type as string2 doesn't solve it.