Groups | Blog | Home
all groups > visual c > january 2004 >

visual c : Declaring a parameter as a REF or OUT ARRAY



Michael Gunter
1/30/2004 5:43:26 PM
Good afternoon,

I am creating an interface in C++ using the managed extensions. I need to
declare a parameter as an out string[] (as would be represented in C#). Does
anyone know how to do this? Declaring out parameters generally takes the
form:

[Out] <type> __gc* name

and arrays generally take the form:

<type> name __gc[];

However, none of the below work:

[Out] <type> name __gc[] __gc*;
[Out] <type> name __gc* __gc[];
[Out] <type> __gc* name __gc[];

Any ideas?

Michael Gunter

Tomas Restrepo (MVP)
1/30/2004 7:22:42 PM
Michael,

[quoted text, click to view]

What you want should probably be:
[Out] String * (&name) __gc[]

(ugly, yes, I know)
--
Tomas Restrepo
tomasr@mvps.org

v-garych NO[at]SPAM online.microsoft.com
2/3/2004 2:38:45 AM
Hi Michael,

Thanks for posting in the community.

From your description, I understand that you want to declare a parameter
as an out string[] in an interface using the managed extensions.

Does Tomas's answer resolve your problem, if you still have questions or
concerns, please feel free to post it in the group.


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
AddThis Social Bookmark Button