thanks guys, here is my situation. i have a class which hold a tree control(activex control), sure tree control offer setItemData(item, data), getITemData(item, &data); here data's type is converted to long*. i wanna store the interface pointer address in the item data, and get it back when i need. VARIANT DelegateGetData(item) { long *data; getItemData(item, data); CComVariant vt; vt.plVal = data; return vt; } CComVariant vt = DeletgateGetData(item); CComPtr spData((IMyInterface*)vt.plVal);//it there any better way here???