How To Cast an Object to a Different Interface (168830)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q168830 SUMMARY
When using an object that has multiple interfaces, you may be faced with
assigning it to multiple variables of different object types to get at
relevant interfaces. This is made more difficult by having to keep track of
the different variables and clean them up properly. This article gives code
for a simple function to allow casting an object to a different interface
without the need to create additional object variables or keep track of
them.
REFERENCES
Microsoft Visual Basic Help topic "Implements Statement"
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto KB168830 |
---|
|