在我使用的一些 IDL 中,我注意到在方法中标记返回值有两种约定 -[in, out]
和[out, retval]
.
似乎[in, out]
在有多个返回值时使用,例如:
HRESULT MyMethod(
[in] long InputParam,
[in, out] long* OutputParam1,
[in, out] long* OutputParam2
);
似乎[out, retval]
只有一个返回值时使用,例如:
HRESULT MyMethod2(
[in] long InputParam,
[out, retval] long* OutputParam1
);
这是 COM IDL 约定还是我正在使用的代码中的约定?
从这两种符号生成的代码是否存在功能差异,或者它们是否完全可以互换?