本文介绍了COM ATL函数[in] [out] [in / out] [retval] [out / retval]参数类型有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为retval用于向用户返回值并输入。但是我无法区分out和retval。我已经阅读了几篇文章,但却无法理解。任何人都可以帮我解释一下吗?

I think retval is used to return a value to the user & in is for input. But i cant differentiate between out & retval. I have gone through several articles but not able to understand it. can anyone explain it for me?

推荐答案


HRESULT Test([out, retval] int *rv) { ... }

将成为

would become

int Test() { ... }

并抛出一个出现错误时的异常(负HRESULT)。

and throw an exception in case of an error (negative HRESULT).


这篇关于COM ATL函数[in] [out] [in / out] [retval] [out / retval]参数类型有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 04:37