ALWAYS inialise a pointer to NULL or a valid address. in the above example a debug build will probably set baseClass to 0 cause a null pointer exception, a release build will set it to a random addess which almost certainly will be the wrong address causing an access violation.
your example has no object instance! if AgentFunction is static call like this: CBaseClass::AgentFunction( goodData )
Also baseClass is a bad name for an object instance, more like baseObj
One more thing use NULL or nullptr not 0, because NULL may not be euivalent 0 it could be a pointer to 0. This is os dependant.
Assuming CBaseClass is not abstact your example could work like this
CBaseClass().AgentFunction( goodData );