In reply to lycos007:
You need to explain how classA and classB are different from each other, and how you expect to use handle. Normally you would just extend classA and classB from a common base class. The you can selectively choose which class to construct, and store its handle in a base class variable.