FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SYSTEM CURRENCY
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
SYSTEM CURRENCY
Posted: Tue Jan 17, 2012 05:18 PM

Hello,

Is there a function that gets system currency?.

Thanks.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: SYSTEM CURRENCY
Posted: Thu Jan 19, 2012 10:09 AM
you can use API function GetLocaleInfo():
Code (fw): Select all Collapse
...
MsgInfo( "The local currency is: '" + GETSCURRENCY() + "'!" )
...
#pragma BEGINDUMP

#include "windows.h"
#include "hbapi.h"
   HB_FUNC( GETSCURRENCY )
   {
   LCID lcid = GetThreadLocale();
   LPSTR value;
   GetLocaleInfo(lcid, LOCALE_SCURRENCY, ( LPSTR )&value, sizeof(value) / sizeof(TCHAR) );
   hb_retc( ( LPSTR )&value );
   } 
#pragma ENDDUMP


See also here for other constants: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: SYSTEM CURRENCY
Posted: Fri Jan 20, 2012 01:00 PM

Thanks.

It works perfect.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82

Continue the discussion