Click here to Skip to main content
15,886,823 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
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?
Posted

hi,
check out these links :
stackoverflow questions[^]

MSDN links::
link 1[^]
link 2[^]

hope this helps !!
 
Share this answer
 
If you code in C/C++ without using any wrapper stuff, then both out and retval would have the same effect.

If you generate wrappers or use other langages, then one argument would become the return vale of the function.

C++
HRESULT Test([out, retval] int *rv) { ... }
would become
C++
int Test() { ... }
and throw an exception in case of an error (negative HRESULT).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900