Export (0) Print
Expand All
COM
id
in
int
odl
out
ptr
ref
Expand Minimize

propget attribute

The [propget] attribute specifies a property accessor function. The property must have the same name as the function.


[propget [,optional-property-attributes]] return-type function-name( parameters);

Parameters

optional-property-attributes

Zero or more property attributes.

return-type

The type of the data returned by the remote procedure.

function-name

The name of the remote procedure.

parameters

Zero or more parameters to the remote procedure.

Remarks

A function that has the propget attribute should also have, as its last parameter, a pointer type with the [out] and [retval] attributes. If the last parameter does not have the [out, retval] attributes, the return value of the function is treated as an [out, retval] parameter. For example, a function with the prototype

[propget] short MyFunction([in] long aLongValue);

is treated as

[propget] HRESULT MyFunction([in] long aLongValue, [out,retval] short *outValue);

At most, one of [propget], [propput], and [propputref] can be specified for a function.

If the [lcid] attribute is used in the parameter list of a function that contains a parameter with the [propput] attribute, the [lcid] parameter must be second to the last.

Flags

INVOKE_PROPERTYGET

Examples

interface MyInterface : IDispatch                         
{                
    [propget, 
     helpstring("A meaningful comment.")] HRESULT Method1(
         [out, retval] int* ReturnVal); 

    [propput, 
     helpstring("Another meaningful comment.")] HRESULT Method1(
         [in] int Value);
        
    [propget, 
     helpstring("A meaningful comment."), id(1)] HRESULT Method2(
         [out, retval] YourInterface** ReturnVal); 

    [propputref, 
     helpstring("Another meaningful comment."), 
     id(1)] HRESULT Method2([in] YourPoint* Point);
}                 

See also

Generating a Type Library With MIDL
ODL File Example
ODL File Syntax
out
retval
propput
propputref
TYPEFLAGS

 

 

Community Additions

ADD
Show:
© 2014 Microsoft