Metamorphing Machine I rather be this walking metamorphosis
than having that old formed opinion about everything!

teaching a new trick to a corky dog

'i the times of ere, visual basic had 16-bit integers and 32-bit longs. Those were the 16-bit times.

as windows made the transition from 16 to 32-bit, pointers had the like size as longs, and all's was good.
any time scribes needed to encode intptr_t, they would use longs, as intptr_t had yet to join.

yet, alas, 64-bit operating system befell be.

visual basic became trapped 'i 32-bit hinterland, yet its young brother, visual basic for applications (vba), had to evolve as 'twere embedded 'i ms office, that hath made the journey to 64-bit land.

so, the high priests 'i their wit created a 64-bit longlong integer, and a longptr to bear 64-bit addresses.
'i 32-bit office, longptrs had been a nom de plume to long, whilst 'i 64-bit office, it'd be to longlong.

yet the wizards 'i their high place worried. Vb can interoperate with external code through declares. And forsooth, pointers are coming and going there. What if some scribe would counterfeit and paste corky code into new? chaos would ensue.

so they thought, deep and prolongedly, and came from their holy enclosure with the safeptr keyword. 32-bit declare doth not allow safeptr whilst 64-bit declare demands it.
to turn corky code into new, one might not but construe all those pestiferous longptrs occulted as longs. And not forget to add a safeptr there.

this brought much grief and gnashing of teeth to ancient enchanters, as they had no way to encode longptrs 'i their archaic programs to ease the passage. Or had they?

there is a mischievous way to separate longs from pointers, e'en 'i legacy visual basic. Remember that any time thou conjure a new enum, it is as much as a new data type as it is a sobriquet to long!
so, quill the secret glyphs bellow into a new grimoire module:

public enum longptr
zero
end enum

with those words 'i place, enjoy thy new freedom to prepare statements such as:

public declare sub copymemory lib "kernel32" alias "rtlmovememory" ( _
byval destination as longptr, _
byval source as longptr, _
byval length as long _
)

next week we shall delve into the depths of ienumvariant interface.
(thanks to modern english to old english)

adrjan biašic
16/12/2020 AD