
Originally Posted by
Peter Swinkels
ps:
I tried this trick in GWbasic, Q(uick) Basic, and vb.net as well. It didn't work.
It's a bug in the compiler and it makes the IDE (interpreter) runtime unstable so should never be used is production (or any other) code.
Just use ArrPtr alias to VarPtr to get pointer to the SAFEARRAY. If this is not nullptr then the cDim As Integer member is in the first 2 bytes.
Code:
Private Declare Function ArrPtr Lib "msvbvm60" Alias "VarPtr" (Ptr() As Any) As Long
cheers,
</wqw>