Is there a way in VB to use a '#define' macro something like in c++? In C++ I can do this:
#define CHECKPTR if(!ptr) AfxMessageBox("Pointer is null");
then everywhere I wanted to do that check, (of course the pointer would always have to be named 'ptr'), I could just write this:
ptr = new CSomePointer;
CHECKPTR
the preprocessor actually expands the text in the appropriate places before compiling the code, so I don't have to have that same code everywhere. Is there a way to do this in VB?