Microsoft KB Archive/832688

= Description of the no_function_mapping compiler directive and the implementation_key compiler directive in Visual C++ .NET or in Visual C++ 2005 =

Article ID: 832688

Article Last Modified on 1/12/2006

-

APPLIES TO


 * Microsoft Visual C++ .NET 2002 Standard Edition
 * Microsoft Visual C++ 2005 Express Edition

-





SUMMARY
This article describes the no_function_mapping compiler directive and the implementation_key compiler directive. This article also describes the compiler errors that you may receive when you use the implementation_key compiler directive. Additionally, it describes how you can resolve the compiler errors for the implementation_key compiler directive.



SYMPTOMS
When you compile the code, you may receive the following error message:

error 2143: syntax error : missing ';'



CAUSE
The implementation_key compiler directive is a compiler-injected directive that is used when a Component Object Model (COM) interface has more than 1000 methods. The Microsoft Visual C++ compiler inserts the implementation_key compiler directive in the TypeLib Information (TLI) Object Library and in the Type Library Header (TLH) files. The injected code may look similar to the following code: __declspec(implementation_key(1)) __declspec(implementation_key(2)) When large numbers of methods are used in the Interface Description Language (IDL) file, the Visual C++ compiler starts to use the #pragma implementation_key compiler directive for each function to improve performance. The #pragma implementation_key compiler directive may cause some side effects, and you may receive the compiler errors in the TLI file that are mentioned in Symptoms section.
 * 1) pragma start_map_region (&quot;...\Namesp.tli&quot;)



RESOLUTION
You can disable the implementation_key compiler directive by adding the undocumented no_function_mapping compiler directive to your #import statement as follows: This code removes the #pragma implementation_key compiler directive from the TLI file and resolves the compiler errors.
 * 1) import &quot;Dllname.dll&quot; no_function_mapping



STATUS
This behavior is by design.

Additional query words: implementation_key no_function_mapping #pragma TLI/TLH directives

Keywords: kberrmsg kbinfo kbtshoot kbdll kbprb kbcompiler KB832688

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.