Where do you want to go next?here's for you :)about homeopathyassorted rantsVB and subclassingVB, screensavers and security concernsLet the Skriptkiddiots play...VB and pointersVB and the Windows shellVB and multitaskingVisual Basiclibrariessnakeoil and blatant liesZoneAlarmeSafefirewall basicsabout harmful codeIn Commerce' Service - sniffersabout spywarecookie jarabout PGPabout privacymain page

Pointers


Who told you, there were no pointers in VB? Kick her/him. No selfesteeming programmer would do without them. Hey, you heard how C-programmers kill an elephant? They nail it down with pointers ;)


In the Object-Viewer (press F2 in the IDE) select "show hidden members". Now have a close look at the VB-library. You'll notice _varptr, _objptr, and _strptr. They're a pointer to a variable, an object, or a string respectively. Wow :)


Now, not much to nail an elephant with, but when you want to pass a STRUCT (or typedef) to a class they're of some value :) Use ByRef for that. ByRef(erence) hands the pointer over, ByVal(ue) the explicit value.


And, wonders always happen, you can even use the AddressOf-operator to pass a pointer to a function where that's needed. Neat, isn't it... It's used for subclassing other functions, so have a look at the DefWindowProc in the MSDN.