QUOTE(KrisSah22 @ 06/02/08, 03:58 AM) [snapback]286583[/snapback]
Now you are obviosly pretty advanced so , what you meant by mono ?
http://www.mono-project.com/Main\_Page
QUOTE(KrisSah22 @ 06/02/08, 03:58 AM) [snapback]286583[/snapback]
And how to do the wrapper? By the way i have Visual Studio NET 2003 (yeah old,gota update ) and i have Microsoft Visual c# and c++ express editions 2008.
going to modify your code example slightly: (It's actually probably the worst example, since there's nothing to bind)
CODE
class Vector
{
public :
float x;
float y;
float z;
void someFunc();
};
Use VC2005 or newer (express editions are fine, though you can't keep all code in a single sln).
Create a CLR class library project type in managed C++, link to whatever lib you are wrapping (in your example your Vector code), then do the wrapping like this:
CODE
namespace MyClassLibrary
{
public ref class NETVector
{
public :
NETVector()
{
v = new Vector;
}
~NETVector()
{
delete v;
}
// wrap funcs
void someFunc()
{
v->someFunc();
}
// wrap member vars as properties
property float x
{
float get() { return v->x; }
void set(float f) { v->x = f; }
}
property float y
{
float get() { return v->y; }
void set(float f) { v->y = f; }
}
property float z
{
float get() { return v->z; }
void set(float f) { v->z = f; }
}
internal:
// provide access to the C++ object to code internal to this dll
// (can be helpful for wrapper code - this won't be available in C#).
Vector* getVector() { return v; }
private:
// the class to wrap
Vector* v;
};
}
QUOTE
And then how to import this so it is ready to use in c#?
And now add the dll it generates to your C# project, now you can do:
[source]
using MyClassLibrary;
NETVector v = new NETVector();
v.x = 2.0f;
v.someFunc();
[/source]
http://www.codeguru.com/columns/Kate/article.php/c7405/
http://www.codeguru.com/cpp/cpp/cpp\_manage...cle.php/c14815/
alternatively do everything using pinvoke
http://www.ondotnet.com/pub/a/dotnet/2002/...cominterop.html