PRB: Property or Method Name Not Recognized on Some Machines

Last reviewed: June 6, 1995
Article ID: Q131053
The information in this article applies to:
  • Microsoft OLE Libraries for Windows and Win32s, version 2.03

SYMPTOMS

If the sLangage and iCountry fields in the [intl] section of WIN.INI are missing or have incorrect entries, IDispatch::GetIDsOfNames fails (it returns the DISP_E_UNKNOWNNAME error) if it is implemented using DispGetIDsOfNames or CreateStdDispatch and a typeinfo created using an INTERFACEDATA structure.

CAUSE

If an automation server's IDispatch is implemented using a typeinfo created from the INTERFACEDATA structure, access of properties or methods may fail on some computers. These computers may have missing or incorrect sLanguage and iCountry fields in the [intl] section of WIN.INI. These fields are used by DispGetIDsOfNames and CreateStdDispatch's IDispatch::GetIDsOfNames to obtain locale information. These functions fail (DISP_E_UNKNOWNNAME) if the locale information cannot be obtained.

RESOLUTION

To solve this problem, modify the fields in WIN.INI to look similar to this:

   [intl]
   sLanguage=enu
   iCountry=1

Where:
  • enu means U.S. English.
  • iCountry specifies the country code. This number matches the country's international telephone code, except for Canada, which is 2. The default is 1.

You can also change these fields by using the International Control Panel applet by selecting the appropriate Country and Language.

STATUS

This behavior is by design. This problem doesn't occur with typeinfos obtained from type libraries. Microsoft strongly recommends that type libraries be used for the implementation of IDispatch. The INTERFACEDATA approach was a temporary solution to create typeinfos while type libraries were in Beta.


Additional reference words: 2.0 2.00
KBCategory: kbprg kbole kbprb
KBSubcategory: LeTwoAto


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: June 6, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.