Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/atl/iunknown.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ms.assetid: e6b85472-e54b-4b8c-b19f-4454d6c05a8f
---
# IUnknown

[IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) is the base interface of every other COM interface. This interface defines three methods: [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q_)), [AddRef](/windows/win32/api/unknwn/nf-unknwn-iunknown-addref), and [Release](/windows/win32/api/unknwn/nf-unknwn-iunknown-release). [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q_)) allows an interface user to ask the object for a pointer to another of its interfaces. [AddRef](/windows/win32/api/unknwn/nf-unknwn-iunknown-addref) and [Release](/windows/win32/api/unknwn/nf-unknwn-iunknown-release) implement reference counting on the interface.
[IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) is the base interface of every other COM interface. This interface defines three methods: [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q)), [AddRef](/windows/win32/api/unknwn/nf-unknwn-iunknown-addref), and [Release](/windows/win32/api/unknwn/nf-unknwn-iunknown-release). [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q)) allows an interface user to ask the object for a pointer to another of its interfaces. [AddRef](/windows/win32/api/unknwn/nf-unknwn-iunknown-addref) and [Release](/windows/win32/api/unknwn/nf-unknwn-iunknown-release) implement reference counting on the interface.

## See also

Expand Down
2 changes: 1 addition & 1 deletion docs/atl/queryinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ms.assetid: 62fce95e-aafa-4187-b50b-e6611b74c3b3
---
# QueryInterface

Although there are mechanisms by which an object can express the functionality it provides statically (before it is instantiated), the fundamental COM mechanism is to use the `IUnknown` method called [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q_)).
Although there are mechanisms by which an object can express the functionality it provides statically (before it is instantiated), the fundamental COM mechanism is to use the `IUnknown` method called [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q)).

Every interface is derived from `IUnknown`, so every interface has an implementation of `QueryInterface`. Regardless of implementation, this method queries an object using the IID of the interface to which the caller wants a pointer. If the object supports that interface, `QueryInterface` retrieves a pointer to the interface, while also calling `AddRef`. Otherwise, it returns the E_NOINTERFACE error code.

Expand Down
2 changes: 1 addition & 1 deletion docs/atl/reference/ccomptrbase-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Returns S_OK on success, or E_NOINTERFACE on failure.

### Remarks

This method calls [IUnknown::QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q_)).
This method calls [IUnknown::QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q)).

In debug builds, an assertion error will occur if *pp* is not equal to NULL.

Expand Down
Loading