How To Expose an MFC OLE Container to VBA Automation (189486)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q189486 SUMMARY
The Microsoft Visual Basic for Applications Container property returns a
pointer to the container's dispatch interface. However, the MFC OLE
container implementation does not support this behavior. When you attempt
to access this property, you get the following Visual Basic for
Applications error:
Run-time error 430, Class does not support automation.
This occurs even if automation support has been added to the container.
For example, in Microsoft Word, the Visual Basic for Applications code
ThisDocument.Container should return the dispatch pointer of the container.
Instead, when run while embedded inside an MFC container application, the
above error is returned.
Support for this property is necessary for Visual Basic for Applications to
have access to automation objects that might be exposed by your MFC OLE
container application.
REFERENCES
Visual C++ Programmer's Guide: search on "Automation Support, ClassWizard"
Microsoft Foundation Class Reference: MFC Technical Notes; TN038: MFC/OLE
IUnknown Implementation
Platform SDK: search on: IServiceProvider
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Mike
Francis, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 7/15/2004 |
---|
Keywords: | kbAutomation kbcode kbContainer kbhowto KB189486 |
---|
|