Arrays

K

kelvin.koogan

In VS2005 I want to declare function that returns an array, e.g.

array<Byte> ^GetData();

However the function is defined in an interface which has to compile
in VS2003 which doesn't support array.

How can I define a function which returns a pointer to an array so it
compiles in VS2000 but has the prototype given above in VS2005.

TIA,
KK
 
P

PvdG42

In VS2005 I want to declare function that returns an array, e.g.

array<Byte> ^GetData();

However the function is defined in an interface which has to compile
in VS2003 which doesn't support array.

How can I define a function which returns a pointer to an array so it
compiles in VS2000 but has the prototype given above in VS2005.

TIA,
KK

I think you're going to have issues with this, as VS 2003 does not support
C++/CLI. VS 2005 was the first to support C++/CLI. VS 2003 supported C++
"with managed extensions", IIRC.

Your best bet may be to look into doing what you need to do in native C++
and wrapping your function for use in the managed environments.
 
D

David Wilkinson

In VS2005 I want to declare function that returns an array, e.g.

array<Byte> ^GetData();

However the function is defined in an interface which has to compile
in VS2003 which doesn't support array.

How can I define a function which returns a pointer to an array so it
compiles in VS2000 but has the prototype given above in VS2005.

KK:

Did you try

Byte __gc[] GetData();

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top