Anders:

If IClient2 is defined in the same type library that you imported (which it
should be), it should be as easy to do as any other interface cast in C#,
like so:

ImportedComNamespace.IClient2 client2 = (ImportedComNamespace.IClient2)
client1;
client2.SomeKickassMethod();

The RCW (runtime callable wrapper) automagically does the QueryInterface()
and the reference counting.

- Peter

-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
Anders Molin
Sent: Monday, April 15, 2002 9:32 AM
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