Microsoft KB Archive/72274

= Declare Currency Type to Be Double When Returning from DLL =

Article ID: 72274

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



This article was previously published under Q72274



SUMMARY
When using Microsoft Visual Basic for Windows, if you want to pass a parameter to a dynamic link library (DLL) routine, or receive a function return value of type Currency from a DLL routine written in Microsoft C, the parameter or function returned should be declared as a &quot;double&quot; in the C routine.

NOTE: C does not support the Basic Currency data type, and although specifying the parameter as type &quot;double&quot; in C will allow it to be passed correctly, you will have to write your own C routines to manipulate the data in the Currency variable. For information on the internal format of the Currency data type, query in the Microsoft Knowledge Base using the following words:

Basic and Currency and internal and format



MORE INFORMATION
When creating a DLL function that either receives or returns a Currency data type, it may be useful to include the following declaration: typedef double currency; Based on this typedef, a sample DLL routine to return a currency value might be declared as follows: currency FAR pascal test(...);

Additional query words: 2.00 3.00

Keywords: KB72274

-

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

© Microsoft Corporation. All rights reserved.