Share via


propget 属性

[propget] 属性は、プロパティ アクセサー関数を指定します。 プロパティの名前は、 関数と同じである必要があります。

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

パラメーター

optional-property-attributes

0 個以上のプロパティ属性。

return-type

リモート プロシージャによって返されるデータの型。

function-name

リモート プロシージャの名前。

parameters

リモート プロシージャに対する 0 個以上のパラメーター。

解説

propget 属性を持つ関数には、最後のパラメーターとして 、[out] 属性と [retval] 属性を持つポインター型も含める必要があります。 最後のパラメーターに [out, retval] 属性がない場合、関数の戻り値は [out, retval] パラメーターとして扱われます。 たとえば、プロトタイプを含む関数

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

は として扱われます。

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

関数には、最大で [propget][propput]、および [propputref] のいずれかを 指定できます。

[propput] 属性を持つパラメーターを含む関数のパラメーター リストで [lcid] 属性を使用する場合、[lcid] パラメーターは最後の 2 番目である必要があります。

Flags

INVOKE_PROPERTYGET

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);
}                 

関連項目

MIDL を使用したタイプ ライブラリの生成

ODL ファイルの例

ODL ファイルの構文

retval

propput

propputref

TYPEFLAGS