G
Guest
I have encapsultated old C/C++ code in a mixed mode C++ module (Project 2).
In my C# app (project 3) I instanciate a managed C++ class. The behaviour of
the C/C++ class is defined by an interface (Project 1). I wanted to add a
getter property to a multi dimension array, but the assembly loader keeps
telling me that the property is not implemented...
When I make a single dimensional array out of it, it works fine...
I added a simplified example of what I did below. Can anybody tell me how I
can get this working???
Thanx, Hans.
file 'IMyInterface.cs' (Project 1)
namespace MyNamespace
{
public interface IMyInterface
{
double[,] MyProperty {get;}
}
}
file 'MyImplementation.h' (Project 2, MyImplementation.cpp is omitted)
using namespace MyNamespace;
[assembly:System::CLSCompliant(true)];
namespace MyNamespace
{
public __gc class MyImplementation: public MyNamespace::IMyInterface
{
private:
double m_MyMember __gc [,];
public:
__property double get_MyProperty() __gc[,] {return m_MyMember;}
}
}
file 'MyApp.cs' (Project 3)
namespace MyNamespace
{
...
...
void MyMethod()
{
IMyInterface myInterface = new MyImplementation(); // causes an
exception...
// How can I get this working?
}
}
In my C# app (project 3) I instanciate a managed C++ class. The behaviour of
the C/C++ class is defined by an interface (Project 1). I wanted to add a
getter property to a multi dimension array, but the assembly loader keeps
telling me that the property is not implemented...
When I make a single dimensional array out of it, it works fine...
I added a simplified example of what I did below. Can anybody tell me how I
can get this working???
Thanx, Hans.
file 'IMyInterface.cs' (Project 1)
namespace MyNamespace
{
public interface IMyInterface
{
double[,] MyProperty {get;}
}
}
file 'MyImplementation.h' (Project 2, MyImplementation.cpp is omitted)
using namespace MyNamespace;
[assembly:System::CLSCompliant(true)];
namespace MyNamespace
{
public __gc class MyImplementation: public MyNamespace::IMyInterface
{
private:
double m_MyMember __gc [,];
public:
__property double get_MyProperty() __gc[,] {return m_MyMember;}
}
}
file 'MyApp.cs' (Project 3)
namespace MyNamespace
{
...
...
void MyMethod()
{
IMyInterface myInterface = new MyImplementation(); // causes an
exception...
// How can I get this working?
}
}