guys,
i have a native struct in a native dll.
and in a managed c++ dll i make a pointer to that struct as follows NVector3 *v;
and in the managed class constructor i create the pointer like so: v = new NVector3();
it compiles fine.
now i create a c# app. and it uses the managed class i did. and i
create an object from the class in managed c++ dll. and that compiles
fine too. but at runtime, i get a stackoverflow exception in the
managed dll, where it is initializing the native pointer "v = new
NVector3();"
wat u guys think the problem is
can somebody help me

allocating native pointer from managed clas
kiran pavuluru
I think you need to do some debugging to figure out exactly what the problem is.
First, I would create a native c++ dummy app of the form:
#include <iostream>
using namespace std;
int main()
{
NVector3 *v;
v = new NVector3();
cout << "NVector3 successfully created." << endl;
}
To make sure your constructor works. If that works, I would try compiling the above /clr (managed). If that also works, I would try using your managed class from managed c++ the same way you are trying to use it through C#. If that still works, then you know the problem is somewhere in the way you are using C#.
Hopefully this helps (or you've already figured it out on your own).
-Ben
needsAnswer
It might be a good idea to double check that all's okay using some tool like Bounds Checker. Whatever bug it was that caused the crash in 2003 may still be present in your 2005 version. Not trying to scare you here of course, but it's better to look for it now than suffer a nasty surprise some time in future.
atame
yeah i solved the problem Ben, thx.
i solved the problem some time ago. as far as i remember, it was a problem in the 2003 compiler. i implemented the same in 2005 and it worked fine without a problem. i didnt really knew what was my problem in the 2003 one.
but it works now under 2005. thx alot for the help :D