all groups > dotnet academic > february 2005 >
You're in the

dotnet academic

group:

C++ .Net Types



C++ .Net Types Ken
2/16/2005 4:47:04 PM
dotnet academic: Hello,

I am having an issue with returning a value from a function in C++ .Net.

I have been using C# .Net for some time and returning a DataSet object
through a function is a valid return type, however when I try to return a
DataSet through a function in C++ .Net I receive a compiler error.

The following code works in C#, but not in C++

using System.Data

DataSet GetCustRecords() {

}

In C++ I receive an error message:

Error C3602: 'DataSet': a __gc type object cannot be passed by value

I've tried to get information on this error message, to find an alternitive
solution however, MSDN says there is no such error number assoicated with
C++, so I'm not sure what's causing the issue.

Can someone please provide a solution to this problem for me?

Re: C++ .Net Types Mattias Sjögren
2/17/2005 6:32:38 AM
[quoted text, click to view]

Use DataSet* as the return type.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Re: C++ .Net Types Ken
2/17/2005 7:39:02 PM
Thanks for the help. That worked! :-)

[quoted text, click to view]
AddThis Social Bookmark Button