I'm doing a set of dlls for use with VB, some of them return a pointer to a class so the VB user can refer to it later. The trouble is if the VB user doesn't pass in the right number or passes in a pointer to a class that's already destroyed the whole thing just crashes.

Is there a way of checkig if a particular address is a pointer to type of class?


thanks in adv