Not through the language itself. You could use a class, as you mentioned, another way is to use the Win32 API.
In particular
HeapAlloc for memory allocation. You will store the returned address in a Long variable.
Then use RTLMoveMemory, renamed CopyMemory, to transfer data to and from allocated memory.
Public Declare Sub CopyMemory Lib "kernel32" Alias _
"RtlMoveMemory" (Destination As Any, Source As Any, _
ByVal Length As Long)
- VB6.