PRB: Add Method/Add Property Adds To All InterfacesLast reviewed: August 7, 1997Article ID: Q168528 |
The information in this article applies to:
SYMPTOMSIn a wizard-generated application that supports Automation, you can use the Add Method or Add Property on the popup menu in the ClassView or in the ClassWizard's Automation tab dialog box to add a method or a property to a dispinterface. The method or the property is added to all of the dispinterfaces in the project's .odl file. This is incorrect. It should only be added to one interface.
CAUSEWhen a dispinterface is created by either ClassWizard or the New Class from the ClassView, the following code skeleton is added to the project's .ODL file:
[ uuid(0C4A40A4-9B05-11D0-81EF-00AA00B92AB3) ] dispinterface ITesting { properties: // NOTE - ClassWizard will maintain property information here. // Use extreme caution when editing this section. //{{AFX_ODL_PROP(CTestingDoc) //}}AFX_ODL_PROP methods: // NOTE - ClassWizard will maintain method information here. // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CTestingDoc) //}}AFX_ODL_METHOD };The AFX_ODL_PROP() and AFX_ODL_METHOD() in the comments are used by the ClassWizard to maintain method/property information. They also specify the object type of the dispinterface. For example, in the sample code above, the dispinterface ITesting is associated with CTestingDoc object. If you created a new dispinterface by copying and pasting an existing dispinterface without making any changes, ClassWizard would be confused if you tried to add a new method or a new property using either the ClassWizard or the popup menu's Add Method/Add Property. Hence, the property or the method is added to both interfaces.
RESOLUTIONTo work around the problem, you can use either one of the following methods:
STATUSMicrosoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional query words: Wizard all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |