How can i get properties of com object dynamically
-
Actually i am developing a class in which it will take any com object and will be able to set and get the properties. Now i have taken the clsid of the component. Now how can i get its properties as GetIdsofNames function of IDispatch takes names. Please Guide me briefly with a little example or tell me some article Thanx in advance Regards minamkhan Inam
-
Actually i am developing a class in which it will take any com object and will be able to set and get the properties. Now i have taken the clsid of the component. Now how can i get its properties as GetIdsofNames function of IDispatch takes names. Please Guide me briefly with a little example or tell me some article Thanx in advance Regards minamkhan Inam
GetIDsOfNames
accepts property names too, but I think you want to know the names of supported properties instead. You need to read the object's type information. You can ask an object if it can provide type information by calling theGetTypeInfo
method ofIDispatch
. You can then find out how many properties it has by callingITypeInfo::GetTypeAttr
. You can get information on the properties withITypeInfo::GetVarDesc
. -
GetIDsOfNames
accepts property names too, but I think you want to know the names of supported properties instead. You need to read the object's type information. You can ask an object if it can provide type information by calling theGetTypeInfo
method ofIDispatch
. You can then find out how many properties it has by callingITypeInfo::GetTypeAttr
. You can get information on the properties withITypeInfo::GetVarDesc
.Sir Actually i have only the progId of the component now i want to also know how i will get the interfaces in this component dynamically than how can i get the names and return types of the properties in the interface dynamically. so that i will be able to get and set the properties in that interface. Sir please explain me little briefly as i am new to this topic. or if possible gave me a little example too. Thanx in advance Regards minamkhan Inam