A
ahmed alhamed via .NET 247
(Type your message here)
Hi, I am trying to write a managed class tha expose
Multiple Indexers Properties To C#, I use the 'DefaultMemberAttribute' Attribute,
but when i use the class from C# I get Strange Compiler Error.
Here Is The Managed C++:
[System::Reflection:efaultMemberAttribute(S"It")]
public __gc class Dummy
{
public public:
__property Int32 get_It(Int32 I)
{
return str;
}
__property String* get_It(String* str)
{
return str;
}
};
When I Try This C# Client:
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Dummy.Dummy d = new Dummy.Dummy();
Console.WriteLine(d[4]);
}
}
it run OK, But When I try This:
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Dummy.Dummy d = new Dummy.Dummy();
Console.WriteLine(d["HH"]);
}
}
The Compiler Give this error:
"error CS1546: Property, indexer, or event '$Item$' is not supported by the language; try directly calling accessor method 'Dummy.Dummy.get_It(string)'"
I Don not if something that i have done is Wrong, Or Something in the
Managed C++ Compiler.
Thanks in Advance.
Hi, I am trying to write a managed class tha expose
Multiple Indexers Properties To C#, I use the 'DefaultMemberAttribute' Attribute,
but when i use the class from C# I get Strange Compiler Error.
Here Is The Managed C++:
[System::Reflection:efaultMemberAttribute(S"It")]
public __gc class Dummy
{
public public:
__property Int32 get_It(Int32 I)
{
return str;
}
__property String* get_It(String* str)
{
return str;
}
};
When I Try This C# Client:
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Dummy.Dummy d = new Dummy.Dummy();
Console.WriteLine(d[4]);
}
}
it run OK, But When I try This:
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Dummy.Dummy d = new Dummy.Dummy();
Console.WriteLine(d["HH"]);
}
}
The Compiler Give this error:
"error CS1546: Property, indexer, or event '$Item$' is not supported by the language; try directly calling accessor method 'Dummy.Dummy.get_It(string)'"
I Don not if something that i have done is Wrong, Or Something in the
Managed C++ Compiler.
Thanks in Advance.