473,386 Members | 1,798 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,386 software developers and data experts.

"Querying" interfaces

Hi,
With COM, I was able to create an object supporting
various interfaces, and by overloading QueryInterface
to decide at runtime if the interface beeing queried was
actually available (given the current state of the object)
or not.
Is there such a possibility with managed .net classes
derived from several interfaces ? Is there some way to
make a dynamic_cast fail ?

Chris.
Nov 17 '05 #1
1 1412
> With COM, I was able to create an object supporting
various interfaces, and by overloading QueryInterface
to decide at runtime if the interface beeing queried was
actually available (given the current state of the object)
or not.
If you implemented such "dynamic" COM objects, you have violated following
rule of COM interfaces:

"The set of interfaces accessible on an object through
IUnknown::QueryInterface must be static, not dynamic. This means that if a
call to QueryInterface for a pointer to a specified interface succeeds the
first time, it must succeed again, and if it fails the first time, it must
fail on all subsequent queries."

(Platform SDK: COM, IUnknown::QueryInterface)
Is there such a possibility with managed .net classes
derived from several interfaces ? Is there some way to
make a dynamic_cast fail ?


To derive such dynamic behaviour, IServiceProvider interface is usually
implemented.

P.S.: COM also has it's own IServiceProvider interface.
--
Vladimir Nesterovsky
e-mail: vl******@nesterovsky-bros.com
home: www.nesterovsky-bros.com
Nov 17 '05 #2

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

Similar topics

14
by: mirnazim | last post by:
Hi, There are great Python Web Application Framework. But most of them are meant for content oriented web apps. Is there something that can ease the development of application that are not...
3
by: Paul Janssen | last post by:
Hello! Can anyone help me out with the following situation: (a) a single query with 550 id's in the IN-clause resulting into 800+ seconds; (b) 550 queries with a single id in the IN-clause...
3
by: beta | last post by:
Hello everyone, I need some help here. If anyone has encountered this, knidly give me your advice. I have a command button (Command0) and a listbox (List1). Upon clicking the command button,...
0
by: Martin Maurer | last post by:
Hello, i have a problem with NameValueCollection.Add or better with converting to a QueryString: NameValueCollection myQueryStringCollection = new NameValueCollection();...
2
by: Chris | last post by:
Hi, With COM, I was able to create an object supporting various interfaces, and by overloading QueryInterface to decide at runtime if the interface beeing queried was actually available (given...
1
by: Job Lot | last post by:
i am querying excel file as follows Dim conn As New OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _ "data source='" & "C:\Temp\SSPortfolio.xls" & " '; " & _ "Extended Properties=Excel...
9
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined...
0
by: bharadwajrv | last post by:
I have created the sequence in the DB2 and i need to query what will be the next possible value for this sequence... Ex. Select NEXT VALUE for schema_name.sequence_name but above sql statement...
4
by: dougmeece | last post by:
Hello everyone, I have created a search button but I receive the message "Microsoft Access can't fine the field "|" referred to in your expression" when I try to use it. I have looked online for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.