Wim ten Brink
asked on
[COM+] ICatalogObject, enumerating VALUES
W2K, COM+ 1.0, Delphi 7...
Okay, I want to have a list of all values of a single ICatalogObject object. Looking at the interface I see NO function to do this. Do you see one in this interface:
ICatalogObject = interface(IDispatch)
['{6EB22871-8A19-11D0-81B6 -00A0C9231 C29}']
function Get_Value(const bstrPropName: WideString): OleVariant; safecall;
procedure Set_Value(const bstrPropName: WideString; retval: OleVariant); safecall;
function Get_Key: OleVariant; safecall;
function Get_Name: OleVariant; safecall;
function IsPropertyReadOnly(const bstrPropName: WideString): WordBool; safecall;
function Get_Valid: WordBool; safecall;
function IsPropertyWriteOnly(const bstrPropName: WideString): WordBool; safecall;
property Value[const bstrPropName: WideString]: OleVariant read Get_Value write Set_Value;
property Key: OleVariant read Get_Key;
property Name: OleVariant read Get_Name;
property Valid: WordBool read Get_Valid;
end;
So I have to access the Value[] property with a known property name. And yes, I know these property names already and I even have a special stringlist which contains these property names for every possible implementation of this interface.
However, what I want is to enumerate all components, interfaces and methods of my COM+ application including ALL value properties. And my code looks less efficient if I cannot enumerate these value property names because it means maintaining lists of value property names myself...
Is there a way to enumerate them? If so, tell me and the points are yours. If not, sorry but I have a working solution already. Just not a very efficient one... I don't need another work-around solution...
Okay, I want to have a list of all values of a single ICatalogObject object. Looking at the interface I see NO function to do this. Do you see one in this interface:
ICatalogObject = interface(IDispatch)
['{6EB22871-8A19-11D0-81B6
function Get_Value(const bstrPropName: WideString): OleVariant; safecall;
procedure Set_Value(const bstrPropName: WideString; retval: OleVariant); safecall;
function Get_Key: OleVariant; safecall;
function Get_Name: OleVariant; safecall;
function IsPropertyReadOnly(const bstrPropName: WideString): WordBool; safecall;
function Get_Valid: WordBool; safecall;
function IsPropertyWriteOnly(const bstrPropName: WideString): WordBool; safecall;
property Value[const bstrPropName: WideString]: OleVariant read Get_Value write Set_Value;
property Key: OleVariant read Get_Key;
property Name: OleVariant read Get_Name;
property Valid: WordBool read Get_Valid;
end;
So I have to access the Value[] property with a known property name. And yes, I know these property names already and I even have a special stringlist which contains these property names for every possible implementation of this interface.
However, what I want is to enumerate all components, interfaces and methods of my COM+ application including ALL value properties. And my code looks less efficient if I cannot enumerate these value property names because it means maintaining lists of value property names myself...
Is there a way to enumerate them? If so, tell me and the points are yours. If not, sorry but I have a working solution already. Just not a very efficient one... I don't need another work-around solution...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tested your code and it worked! Wonderful! Now my application isn't just a bit easier, it is also better compatible with newer Windows versions. Especially the differences between W2K and W2K+3 were a bit difficult to overcome if I had to maintain a list of constants. :-)