You receive a DISP_E_UNKNOWNNAME error when calling IDispatch::GetIDsOfNames () for an ATL server and named arguments (223165)



The information in this article applies to:

  • The Microsoft Active Template Library (ATL) 3.0, when used with:
    • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
    • Microsoft Visual C++, 32-bit Professional Edition 6.0
    • Microsoft Visual C++, 32-bit Learning Edition 6.0

This article was previously published under Q223165

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 was corrected in Visual Studio 6.0 Service Pack 3.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, click the following article number to view the article in the Microsoft Knowledge Base:

194022 Visual Studio 6.0 service packs, what, where, why

194295 How to tell that Visual Studio 6.0 service packs are installed


Modification Type:MajorLast Reviewed:4/29/2005
Keywords:kbtshoot kbATL300fix kbAutomation kbBug kbFAQ kbfix kbVS600sp3fix KB223165 kbAudDeveloper