How to pass optional arguments to a method on an ActiveX Control
Article ID: 154039
Article Last Modified on 11/21/2006
APPLIES TO
- Microsoft Foundation Class Library 4.2, when used with:
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft Visual C++ .NET 2002 Standard Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
This article was previously published under Q154039
Note Microsoft Visual C++ .NET (2002) supports both the managed code
model that is provided by the Microsoft .NET Framework and the unmanaged native
Microsoft Windows code model. The information in this article applies only to
unmanaged Visual C++ code.
SUMMARY
Many automation methods on ActiveX Controls do not require
that all possible arguments are passed with each call. Arguments that are not
required are called optional arguments. In MFC, it is possible to add a method
to a custom control that accepts optional arguments, but there are a few rules
that must be followed. This article outlines these rules, and provides
step-by-step instruction on how to add such a method to a control.
REFERENCES
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
140616
MFCDISP: Replacing MFC IDispatch implementation
For more information, see the following resources:
- Visual C++ Books Online
- Programming with MFC:
Encyclopedia
Additional query words: LPDispatch IDispatch kbinf OCX
Keywords: kbautomation kbctrlcreate kbhowto KB154039