Syntax
INT = GetComProperty(IDispatch obj, string fmt, uint value, string property, ...)
Description
Retrieves the property of a COM object using script syntax.
Parameters
obj - The Object returned by the CREATECOMOBJECT command.
fmt - Formatting string for the returned property.
value - Address of a variable to store the property in.
property - Name of the property to retrieve.
... - Optional parameter list.
Return value
0 for Success.
Remarks
Pass the address of your variable using the & operator. Parameters can be supplied to property names when needed.
Formatting strings are specified by using C printf-like specifiers. The table below shows the supported specifiers:
Identifier
|
Type
|
%d
|
INT
|
%u
|
UINT
|
%e
|
DOUBLE
|
%b
|
INT
|
%v
|
VARIANT UDT.
|
%B
|
BSTR - Created with the AllocSysString API function
|
%s
|
STRING
|
%S
|
WSTRING
|
%T
|
WSTRING
|
%o
|
IDispatch COM object
|
%O
|
IUnknown COM object
|
%t
|
C time_t UDT
|
%W
|
SYSTEMTIME UDT
|
%f
|
FILETIME UDT
|
%D
|
C date type.
|
%p
|
POINTER
|
%m
|
Specifies a missing/optional argument
|
Example usage(s)
GetComProperty(_xmlDoc, "%s", &_pTemp, ".documentElement.Attributes.getNamedItem(%s).value", "author")
IDispatch Connection
POINTER szResponse
INT _status
Connection = CreateComObject("MSXML2.XMLHTTP.3.0", "")
CallObjectMethod(Connection, ".Open(%s, %s, %b)", "GET", "http://myserver.com/test.xml", FALSE)
CallObjectMethod(Connection, ".Send")
GetComProperty(Connection, "%d", &_status, ".status")
if _status = 200
GetComProperty(Connection, "%T", &_szResponse, ".ResponseXML.xml")
PRINT w2s(*<wstring>_szResponse)
FreeComString(_szResponse)
endif
Connection->Release()
|