tags:

views:

74

answers:

1

Hi, I want to create a simple COM component in VC++ 2008. I have created ATL Project with all default options. I have added Simple ATL object (interface IDemo). Now I want to add a methos inside IDemo. But the "Add Method Wizard" does not allow me to add out/retval type of parameters to the method. I can add in type of parameters.

Is it possible to add out/retval type of parameters? If yes then How can I do it?

Thanks

+2  A: 

If you select any parameter of type pointer then only it enables the out and retval checkboxes. For non pointer type parameters it doesn't enable the out and retval checkboxes.

E.g. if you select CHAR as the parameter type then the out and retval checkboxes are not enabled where as if you select CHAR * as the parameter type then the out and retval checkboxes are enabled.

Which is how it has to be since it's a parameter that COM will treat as a return value (depending on the client) rather than a real return value.
ho1