How To Pass a COleDispatchDriver as an Argument for a Method Expecting a VARIANT (253501)
The information in this article applies to:
- Microsoft Office Word 2003
- Microsoft Word 2002
- Microsoft Word 2000
- Microsoft Word 97 for Windows
- Microsoft Office Excel 2003
- Microsoft Excel 2002
- Microsoft Excel 2000
- Microsoft Excel 97 for Windows
- Microsoft Office PowerPoint 2003
- Microsoft PowerPoint 2002
- Microsoft PowerPoint 2000
- Microsoft PowerPoint 97 for Windows
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- The Microsoft Foundation Classes (MFC)
This article was previously published under Q253501 SUMMARY Some methods require that you pass a VARIANT that represents an Automation object. With MFC, these objects are typically handled by COleDispatchDriver-derived classes. To pass one of these to a method expecting a VARIANT, you can create a new VARIANT with its vt member set to VT_DISPATCH and its pdispVal member set to the COleDispatchDriver class's m_lpDispatch. REFERENCES For
additional information on creating an MFC Automation client for Microsoft
Office applications, click the following article number to view the article in
the Microsoft Knowledge Base: 178749
How To Create Automation Project
Using MFC and a Type Library
For additional information and sample for
developing Office solutions, please visit:
Modification Type: | Minor | Last Reviewed: | 7/24/2006 |
---|
Keywords: | kbAutomation kbhowto KB253501 |
---|
|