How to override an interface in an MFC application by using Visual C++ (141277)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ 2005 Express Edition
This article was previously published under Q141277 Note Microsoft Visual C++ NET (2002) supported both the managed code
model that is provided by the .NET Framework and the unmanaged native Windows
code model. The information in this article applies to unmanaged Visual C++
code only.
Note Microsoft Visual C++ 2005 supported both the managed code
model that is provided by the .NET Framework and the unmanaged native Windows
code model. SUMMARY In an MFC application, you can override existing interfaces
in a class as well as provide additional interfaces. Overriding an interface in
this case is synonymous with replacing an interface. The example in this
article illustrates how to override an interface in a class while preserving
the original interface implementation so that it can be delegated to by the new
interface implementation. This article does not deal with overriding
the IDispatch implementation, as this is a special case.
For more information about how to override IDispatch in MFC, click the following article number to view the article in the Microsoft Knowledge Base:
140616
Replacing MFC IDispatch implementation
REFERENCES Technical Notes #38 and #39.
Modification Type: | Major | Last Reviewed: | 12/10/2005 |
---|
Keywords: | kbArchitecture kbCtrl kbhowto KB141277 kbAudDeveloper |
---|
|