Win32 API 日本語リファレンス
ホームGlobalization › ucurr_openISOCurrencies

ucurr_openISOCurrencies

関数
条件に合うISO通貨コードの列挙子を開く。
DLLicuuc.dll呼出規約cdecl

シグネチャ

// icuuc.dll
#include <windows.h>

UEnumeration* ucurr_openISOCurrencies(
    DWORD currType,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
currTypeDWORDin
pErrorCodeUErrorCode*inout

戻り値の型: UEnumeration*

各言語での呼び出し定義

// icuuc.dll
#include <windows.h>

UEnumeration* ucurr_openISOCurrencies(
    DWORD currType,
    UErrorCode* pErrorCode
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ucurr_openISOCurrencies(
    uint currType,   // DWORD
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucurr_openISOCurrencies(
    currType As UInteger,   ' DWORD
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' currType : DWORD
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function ucurr_openISOCurrencies Lib "icuuc" ( _
    ByVal currType As Long, _
    ByRef pErrorCode As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucurr_openISOCurrencies = ctypes.cdll.icuuc.ucurr_openISOCurrencies
ucurr_openISOCurrencies.restype = ctypes.c_void_p
ucurr_openISOCurrencies.argtypes = [
    wintypes.DWORD,  # currType : DWORD
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ucurr_openISOCurrencies = Fiddle::Function.new(
  lib['ucurr_openISOCurrencies'],
  [
    -Fiddle::TYPE_INT,  # currType : DWORD
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ucurr_openISOCurrencies(
        currType: u32,  // DWORD
        pErrorCode: *mut i32  // UErrorCode* in/out
    ) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ucurr_openISOCurrencies(uint currType, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucurr_openISOCurrencies' -Namespace Win32 -PassThru
# $api::ucurr_openISOCurrencies(currType, pErrorCode)
#uselib "icuuc.dll"
#func global ucurr_openISOCurrencies "ucurr_openISOCurrencies" sptr, sptr
; ucurr_openISOCurrencies currType, pErrorCode   ; 戻り値は stat
; currType : DWORD -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global ucurr_openISOCurrencies "ucurr_openISOCurrencies" int, int
; res = ucurr_openISOCurrencies(currType, pErrorCode)
; currType : DWORD -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; UEnumeration* ucurr_openISOCurrencies(DWORD currType, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#cfunc global ucurr_openISOCurrencies "ucurr_openISOCurrencies" int, int
; res = ucurr_openISOCurrencies(currType, pErrorCode)
; currType : DWORD -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procucurr_openISOCurrencies = icuuc.NewProc("ucurr_openISOCurrencies")
)

// currType (DWORD), pErrorCode (UErrorCode* in/out)
r1, _, err := procucurr_openISOCurrencies.Call(
	uintptr(currType),
	uintptr(pErrorCode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // UEnumeration*
function ucurr_openISOCurrencies(
  currType: DWORD;   // DWORD
  pErrorCode: Pointer   // UErrorCode* in/out
): Pointer; cdecl;
  external 'icuuc.dll' name 'ucurr_openISOCurrencies';
result := DllCall("icuuc\ucurr_openISOCurrencies"
    , "UInt", currType   ; DWORD
    , "Ptr", pErrorCode   ; UErrorCode* in/out
    , "Cdecl Ptr")   ; return: UEnumeration*
●ucurr_openISOCurrencies(currType, pErrorCode) = DLL("icuuc.dll", "void* ucurr_openISOCurrencies(dword, void*)")
# 呼び出し: ucurr_openISOCurrencies(currType, pErrorCode)
# currType : DWORD -> "dword"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。