Microsoft KB Archive/73654

= Basic PDS ALIAS Example on Page 430 Can Give LINK Error L2029 =

Article ID: 73654

Article Last Modified on 11/21/2006



This article was previously published under Q73654



SUMMARY
The DECLARE statement on page 430 of the &quot;Microsoft Basic 7.0: Programmer's Guide&quot; (for versions 7.0 and 7.1) under the example on &quot;Using ALIAS&quot; is incomplete. The incomplete DECLARE statement is listed in the manual as follows: DECLARE FUNCTION QuadResult% ALIAS &quot;quad_result&quot; (a, b, c) The explanation of the DECLARE statement implies that the FUNCTION &quot;quad_result&quot; is to be used with a C function. If you create a standard C function called quad_result and attempt to link the compiled code to a Basic program that calls the function, you will receive a &quot;L2029: Unresolved external&quot; error at link time. The problem is that the DECLARE FUNCTION example is designed for a function that uses the Pascal naming and calling convention, not the C naming and calling convention. In order for the example to work with a standard C function, the DECLARE FUNCTION example needs to be changed in the following two ways:


 * 1) Add the CDECL clause before ALIAS.
 * 2) Append an underscore to the beginning of the ALIAS name. For example, change &quot;quad_result&quot; to &quot;_quad_result&quot;.

The DECLARE statement on page 430 should thus be changed as follows: DECLARE FUNCTION QuadResult% CDECL ALIAS &quot;_quad_result&quot; (a, b, c) This information applies to Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2.



MORE INFORMATION
For more information on how the ALIAS clause works, query on the following words:

alias AND underscore

Additional query words: BasicCom 7.00 7.10

Keywords: KB73654

-

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

© Microsoft Corporation. All rights reserved.