Class StdLibAsAnyAttribute
States that a standard-library parameter is ByRef … As Any, as a Declare's can be: it takes a variable of any type but an array, and the
member is given where the variable is - its address in the session's memory - rather than what it holds.
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class StdLibAsAnyAttribute : Attribute
- Inheritance
-
StdLibAsAnyAttribute
- Inherited Members
Remarks
The parameter is declared as a VBLongLongValue, whatever the width of the environment's pointers: what it is given is
- the address of a variable passed to it;
- the address of a temporary, for what is no variable (a literal, an expression, what a function returns), which is freed when the statement that passes it is over;
- the bytes a
ByValargument is stored in, read as a whole number - which is how MS-VBA passes it (recorded in Excel): a whole number is itself, aDoubleits bits, aVariantitsVARIANT's type.
VarPtr is declared so, as the VBA type library declares it: VarPtr(Ptr As Any) As LongPtr.