R
Ray Deese
Hi
I have quite a strange problem that I can't seem to overcome on my own. I have a managed C++ web service which has one webmethod. This method returns an array of a class with 1 property in it. This array is created by another class which has IEnumerable and IEnumerator as its base class so that I can DataBind this type in the consuming application. The web service compiles fine but when you run it, it returns the following errors in the stack trace
[NullReferenceException: Object reference not set to an instance of an object.
[InvalidOperationException: There was an error reflecting 'QuickSortResult'.
[InvalidOperationException: Method CService.QuickSort can not be reflected.
[InvalidOperationException: Unable to handle request.
[InvalidOperationException: Failed to handle request.
I have created 2 different projects, a console application and a class library - both of those would compile the same code (mines the system::web stuff) just fine - the console app would run nicely and the class library was able to be referenced inside of another application and invoked. So suffice to say, I'm stuck! Here is the pertinent code below
Number.h simply implement a class with a single property with get & set implemente
-----------------------------------------------------------------
//numbers.
namespace numbersnamespac
__gc public class numbers : public IEnumerable, public IEnumerato
private
static int position = -1;
public:
number *enumerator[];
numbers(
enumerator = new number * [NUM_ITEMS]
------------------------------------------------------------------------
//Main.h
__gc public class CServic
{
public:
[WebMethod
numbers* QuickSort();
------------------------------------------------------------------------
//Main.cp
numbers* CService::QuickSort(
{
//non important code is left ou
numbers *sdata = new numbers()
for (i = 0; i < NUM_ITEMS; i++
sdata->enumerator = new number(__numbers);
return sdata
Any help/suggections are much appreciated, my email address is listed as well in case you would like to contact me that way
Thanks in advance
-Ray
I have quite a strange problem that I can't seem to overcome on my own. I have a managed C++ web service which has one webmethod. This method returns an array of a class with 1 property in it. This array is created by another class which has IEnumerable and IEnumerator as its base class so that I can DataBind this type in the consuming application. The web service compiles fine but when you run it, it returns the following errors in the stack trace
[NullReferenceException: Object reference not set to an instance of an object.
[InvalidOperationException: There was an error reflecting 'QuickSortResult'.
[InvalidOperationException: Method CService.QuickSort can not be reflected.
[InvalidOperationException: Unable to handle request.
[InvalidOperationException: Failed to handle request.
I have created 2 different projects, a console application and a class library - both of those would compile the same code (mines the system::web stuff) just fine - the console app would run nicely and the class library was able to be referenced inside of another application and invoked. So suffice to say, I'm stuck! Here is the pertinent code below
Number.h simply implement a class with a single property with get & set implemente
-----------------------------------------------------------------
//numbers.
namespace numbersnamespac
__gc public class numbers : public IEnumerable, public IEnumerato
private
static int position = -1;
public:
number *enumerator[];
numbers(
enumerator = new number * [NUM_ITEMS]
------------------------------------------------------------------------
//Main.h
__gc public class CServic
{
public:
[WebMethod
numbers* QuickSort();
------------------------------------------------------------------------
//Main.cp
numbers* CService::QuickSort(
{
//non important code is left ou
numbers *sdata = new numbers()
for (i = 0; i < NUM_ITEMS; i++
sdata->enumerator = new number(__numbers);
return sdata
Any help/suggections are much appreciated, my email address is listed as well in case you would like to contact me that way
Thanks in advance
-Ray