Article ID: 179691 - Last Review: June 2, 2005 - Revision: 3.0 The dispatch identifiers change when you add properties to existing Automation objects by using ClassWizardThis article was previously published under Q179691 SYMPTOMS
When adding properties by using ClassWizard to existing Automation objects,
the dispatch identifiers (DISPIDs) of any methods will change. Although changing DISPIDs does not usually cause a problem when originally building an Automation server, it can cause incompatibility problems when updating existing Automation objects. Automation clients that were built using early binding will no longer work with the updated server. CAUSE
ClassWizard adds properties to MFC's "dispatch map" before methods.
Because, by default, DISPIDs are assigned to interfaces based on the order
in which they are added to the map, adding a property changes the IDs of
all the existing methods.
RESOLUTION
Add properties and methods to the dispatch map and the .odl file without
using ClassWizard. You should add these additional properties outside the ClassWizard comments at the end of the dispatch map. STATUS
Microsoft is researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
There are several MFC dispatch DISP_XXXX_ID macros that allow you to
specify a specific DISPID:
DISP_FUNCTION_ID() DISP_PROPERTY_ID() DISP_PROPERTY_NOTIFY_ID() DISP_PROPERTY_EX_ID() DISP_PROPERTY_PARAM_ID() Here is an sample dispatch map from a sample control: REFERENCES
For more information on MFC dispatch macros and how MFC assigns DISPIDs,
see MFC TechNote TN039 in the Visual C++ Documentation.
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Kelly Marie Ward, Microsoft Corporation. APPLIES TO
| Article Translations
|

Back to the top
