473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

COM and interface

Hi everybody,

I am starting with C#. I have COM object, which sometimes exposes
IEnumTerminal interface and sometimes it doesn't, because exsistence of this
interface depends on the other factors.

My question is, how may I find out with IAddress interface (interface of my
COM object), whether my COM object exposes the IEnumTerminal interface?

I know, how to do it in other programming languages (using
IAddress->QueryInterface), but I have problem to do it in C#.

Thanks you a lot

Ondrej

Nov 16 '05 #1
2 1054
Using a cast will QI under the covers:

IEnumTerminal enumTerm = IAddress as IEnumTerminal ;
if(enumTerm != null)
{
// OK QI succeeded
// do someting with it
}
else
// QI for IEnumTerminal failed

Willy.
PS. please post interop questions to the interop NG -
microsoft.public.dotnet.framework.interop.

"Ondrej" <ie**@ynet.sk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi everybody,

I am starting with C#. I have COM object, which sometimes exposes
IEnumTerminal interface and sometimes it doesn't, because exsistence of
this interface depends on the other factors.

My question is, how may I find out with IAddress interface (interface of
my COM object), whether my COM object exposes the IEnumTerminal interface?

I know, how to do it in other programming languages (using
IAddress->QueryInterface), but I have problem to do it in C#.

Thanks you a lot

Ondrej

Nov 16 '05 #2
Willy, thanks very much.

Ondrej

"Willy Denoyette [MVP]" <wi*************@pandora.be> napísal v správe
news:%2****************@TK2MSFTNGP12.phx.gbl...
Using a cast will QI under the covers:

IEnumTerminal enumTerm = IAddress as IEnumTerminal ;
if(enumTerm != null)
{
// OK QI succeeded
// do someting with it
}
else
// QI for IEnumTerminal failed

Willy.
PS. please post interop questions to the interop NG -
microsoft.public.dotnet.framework.interop.

"Ondrej" <ie**@ynet.sk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi everybody,

I am starting with C#. I have COM object, which sometimes exposes
IEnumTerminal interface and sometimes it doesn't, because exsistence of
this interface depends on the other factors.

My question is, how may I find out with IAddress interface (interface of
my COM object), whether my COM object exposes the IEnumTerminal
interface?

I know, how to do it in other programming languages (using
IAddress->QueryInterface), but I have problem to do it in C#.

Thanks you a lot

Ondrej


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.