One more pointer, which might be of interest to you: When passing pointers, you can just declare it without BYVAL.
Instead of:
FUNCTION CryptBinaryToString%% ALIAS CryptBinaryToStringA (BYVAL pbBinary AS _OFFSET....
You can go with:
FUNCTION CryptBinaryToString%% ALIAS CryptBinaryToStringA (pbBinary AS STRING....
Then when you call the function, instead of this:
a = CryptBinaryToString(_OFFSET(encode)....
It'd be:
a = CryptBinaryToString(encode....
It might be a trick to help simplify your libraries a bit, and cut down on some typing for you. (Not just on strings, but all cases where pointers to something is required, rather than the actual data value itself.)
Not that what you're doing is wrong; I just thought you might not realize WHY that BYVAL is there, and what we do when it's not. ;)
With BYVAL, we pass the value.
Without it, we pass the offset to whatever.