Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
Can you describe IUKNOWN interface in brief ?
.NET INTERVIEW QUESTIONS - Can you describe IUKNOWN interface in brief ?
✍: Guest
Every COM object supports at least one interface, the IUnknown interface. All interfaces are classes derived from the base class IUnknown. Each interface supports methods access data and
perform operations transparently to the programmer. For example, IUnknown supports three methods, AddRef, Release(), and QueryInterface(). Suppose that pinterf is a pointer to an IUnknown.
pinterf->AddRef() increments the reference count.
pinterf->Release() decrements the reference count, deleting the object when the reference count reaches zero.
pinterf->QueryInterface( IDesired,
pDesired) checks to see if the current interface (IUnknown) supports another interface, IDesired, creates an instance (via a call to CoCreateInstance()) of the object if the reference count is zero (the object does not yet exist), and then calls pDesired->AddRef() to increment the reference count (where pDesired is a pointer to IDesired) and returns the pointer to the caller.
2010-01-19, 3974👍, 0💬
Popular Posts:
Can we have shared events ? Yes, you can have shared event’s note only shared methods can raise shar...
What is test metrics? Test metrics accomplish in analyzing the current level of maturity in testing ...
Does .NET support UNICODE and how do you know it supports? Yes .NET definitely supports UNICODE. Try...
.NET INTERVIEW QUESTIONS - What is Multi-tasking ? It’s a feature of modern operating systems with w...
Where are all .NET Collection classes located ? System.Collection namespace has all the collection c...