I have the class CItem, with a derived class called CItemBox.
I can easily cast an CItem to CItemBox with this:
but how can i cast when i have a Type class instance of CItemBox?
This doesnt work:
is there anyway to do this? Cast with only a Type instance of CItemBox?
I can easily cast an CItem to CItemBox with this:
Code:
((CItemBox)InstanceOfCItem).MethodOfCItemBox();
but how can i cast when i have a Type class instance of CItemBox?
This doesnt work:
Code:
((typeof(CItemBox))InstanceOfCItem).MethodOfCItemBox();
is there anyway to do this? Cast with only a Type instance of CItemBox?