K
Kimmo Laine
Hi,
we have a (unmanaged) ATL COM server, which implements two interface:
ITestInterface1 and ITestInterface2. Both of these interfaces also support
the ISupportErrorInfo-interface.
Interface implementation is divided into two class: CTestInterface2, which
implements the ITestInterfac2, and CTestInterface1, which implements
ITestInterface1 AND ITestInterface2.
ITestInterface1 has only 1 method which is implemented like this:
// IDS_TESTSTRING_1 is defined in stringtable and it says "Error in
ShowLong"
// Methodname: : ShowLong
HRESULT hRes = Error( IDS_TESTSTRING_1 );
return hRes;
ITestInterface2 has also only 1 method and it is implemented like this:
// IDS_TESTSTRING_2 is defined in stringtable and it says "Error in
ShowChar"
// Methodname : ShowChar
HRESULT hRes = Error( IDS_TESTSTRING_2 );;
return hRes;
Now, when i code, in VB 6, something like this
Dim my1 As ATLSERVERLib.TestInterface1
Dim my2 As ATLSERVERLib.TestInterface2
' . . .
Set my1 = New ATLSERVERLib.TestInterface1
Set my2 = my1
my2.ShowChar
i get a nice exception which says "Error in ShowChar".
But when i do the same in C#
private ATLSERVERLib.TestInterface1 my1;
private ATLSERVERLib.TestInterface2 my2;
// . . .
my1 = new ATLSERVERLib.TestInterface1();
my2 = (ATLSERVERLib.TestInterface2)ti1;
my2.ShowChar();
i get a exception which says: "Exception from HRESULT: 0x80041172."
Any ideas? If you like, i can post the sourcecode for all of these projects.
thx
Kimmo Laine
we have a (unmanaged) ATL COM server, which implements two interface:
ITestInterface1 and ITestInterface2. Both of these interfaces also support
the ISupportErrorInfo-interface.
Interface implementation is divided into two class: CTestInterface2, which
implements the ITestInterfac2, and CTestInterface1, which implements
ITestInterface1 AND ITestInterface2.
ITestInterface1 has only 1 method which is implemented like this:
// IDS_TESTSTRING_1 is defined in stringtable and it says "Error in
ShowLong"
// Methodname: : ShowLong
HRESULT hRes = Error( IDS_TESTSTRING_1 );
return hRes;
ITestInterface2 has also only 1 method and it is implemented like this:
// IDS_TESTSTRING_2 is defined in stringtable and it says "Error in
ShowChar"
// Methodname : ShowChar
HRESULT hRes = Error( IDS_TESTSTRING_2 );;
return hRes;
Now, when i code, in VB 6, something like this
Dim my1 As ATLSERVERLib.TestInterface1
Dim my2 As ATLSERVERLib.TestInterface2
' . . .
Set my1 = New ATLSERVERLib.TestInterface1
Set my2 = my1
my2.ShowChar
i get a nice exception which says "Error in ShowChar".
But when i do the same in C#
private ATLSERVERLib.TestInterface1 my1;
private ATLSERVERLib.TestInterface2 my2;
// . . .
my1 = new ATLSERVERLib.TestInterface1();
my2 = (ATLSERVERLib.TestInterface2)ti1;
my2.ShowChar();
i get a exception which says: "Exception from HRESULT: 0x80041172."
Any ideas? If you like, i can post the sourcecode for all of these projects.
thx
Kimmo Laine