Client tc = new Client();
IClient2 client2 = (IClient2)tc;

You need to explicitly cast non-default interfaces ;)


Morty

-----Original Message-----
From: Anders Molin [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 15, 2002 3:32 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Using COM from C# (Multible Interfaces)

Hi,

I have a COM object with 2 interfaces, IClient and IClient2, that I'm
using from C#.

Using the object with the first interface is easy, I just add it to my
project with "Project/Add Reference", and create it like this: 
Client tc = new Client();

Then I get access to all the functions in the IClient interface.
But, I also have a newer interface, IClient2, which implements all
methods from IClient and some new ones, but I can't figure out how to
use IClient2  

Anyone have a good idea?  
 
Thanks in anvance,

Anders Molin

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to