F
Fox
Hi all,
I would like to ask you a question regarding inheritence in C#.
I have a class which inherits from COM object, but then I want to pass
this class to the function expecting interface which COM object is
inherited from, I can't do it.
See sample:
C++ ATL project with COM interface A and COM object AInst
interface A
{
// some methods
}
class AInst : public A
{
// some methods
}
In C# I would like to do:
class AInstCSharp : public AInst
{
}
class B
{
public static void Do( A a )
{
//do something
}
}
Now somewhere in C# code:
AInstCSharp a = new AInstCSharp();
//next line will not compile due to an error CS1502
B.Do( a );
It seems that original interface A can't be used and also in object
browser I can't see that class AInstCSharp is inherited from A.
Do you have any idea how I can use it?
Fox
I would like to ask you a question regarding inheritence in C#.
I have a class which inherits from COM object, but then I want to pass
this class to the function expecting interface which COM object is
inherited from, I can't do it.
See sample:
C++ ATL project with COM interface A and COM object AInst
interface A
{
// some methods
}
class AInst : public A
{
// some methods
}
In C# I would like to do:
class AInstCSharp : public AInst
{
}
class B
{
public static void Do( A a )
{
//do something
}
}
Now somewhere in C# code:
AInstCSharp a = new AInstCSharp();
//next line will not compile due to an error CS1502
B.Do( a );
It seems that original interface A can't be used and also in object
browser I can't see that class AInstCSharp is inherited from A.
Do you have any idea how I can use it?
Fox