PRB: Error 0x80020004 (-2147352572) When Setting a Property

Last reviewed: October 27, 1997
Article ID: Q175618
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)

SYMPTOMS

You get the error DISP_E_PARAMNOTFOUND when you try to set a property.

CAUSE

The DISPPARAMS structure must be initialized in a special way for DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF.

RESOLUTION

When you use IDispatch::Invoke() with DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, you have to specially initialize the cNamedArgs and rgdispidNamedArgs elements of your DISPPARAMS structure with the following:

   DISPID dispidNamed = DISPID_PROPERTYPUT;
   dispparams.cNamedArgs = 1;
   dispparams.rgdispidNamedArgs = &dispidNamed;

STATUS

This behavior is by design.

MORE INFORMATION

This behavior is necessary because some OLE Automation servers, as a result of their language structure, cannot differentiate between a property get or put and a method call. This specially named argument case is used to determine what is actually going on.

REFERENCES

"Inside OLE," Kraig Brocksmidt, Chapter 14, "The IDispatch interface" section, Microsoft Press, 1995


Additional query words: Visual C++ DISP_E_PARAMNOTFOUND "Parameter not
found"
Keywords : BseMisc kberrmsg
Version : WINNT:
Platform : winnt
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.