FIX: ATL's GetIDsOfNames( ) Returns DISP_E_UNKNOWNNAME for Named Arguments

ID: Q223165


The information in this article applies to:


SYMPTOMS

When calling IDispatch::GetIDsOfNames() for an ATL server and named arguments are passed in, you receive the following error:

0x80020006 (DISP_E_UNKNOWNNAME)
If the client is Visual Basic and you call a method in an ATL server passing named arguments then you receive this error message:
Run-time error '448':
Named argument not found


CAUSE

In the function CComTypeInfoHolder::GetIDsOfNames() (called by IDispatch::GetIDsOfNames()), ATL looks up the DISPID through a cached array. If the call to GetIDsOfNames() includes named arguments then these entries are not in the array. In that case, CComTypeInfoHolder::GetIDsOfNames() delegates to ITypeInfo::GetIDsOfNames(). It calls ITypeInfo::GetIDsOfNames() once for each named argument in the method. To get the IDs of named arguments then ITypeInfo::GetIDsOfNames() needs to be called with the method name in addition to the named arguments.


RESOLUTION

This bug has been fixed in Visual Studio 6.0 Service Pack 3.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

Additional query words:


Keywords          : kbservicepack kbAutomation kbVC600 kbATL300fix kbVS600sp2 kbVS600SP1 kbVS600sp3fix kbATL300faq 
Version           : WINDOWS:3.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 19, 1999