ホーム › Globalization › uloc_getLCID
uloc_getLCID
関数ロケールIDに対応するWindows LCIDを取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
DWORD uloc_getLCID(
LPCSTR localeID
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| localeID | LPCSTR | in |
戻り値の型: DWORD
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
DWORD uloc_getLCID(
LPCSTR localeID
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint uloc_getLCID(
[MarshalAs(UnmanagedType.LPStr)] string localeID // LPCSTR
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uloc_getLCID(
<MarshalAs(UnmanagedType.LPStr)> localeID As String ' LPCSTR
) As UInteger
End Function' localeID : LPCSTR
Declare PtrSafe Function uloc_getLCID Lib "icuuc" ( _
ByVal localeID As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uloc_getLCID = ctypes.cdll.icuuc.uloc_getLCID
uloc_getLCID.restype = wintypes.DWORD
uloc_getLCID.argtypes = [
wintypes.LPCSTR, # localeID : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
uloc_getLCID = Fiddle::Function.new(
lib['uloc_getLCID'],
[
Fiddle::TYPE_VOIDP, # localeID : LPCSTR
],
-Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn uloc_getLCID(
localeID: *const u8 // LPCSTR
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint uloc_getLCID([MarshalAs(UnmanagedType.LPStr)] string localeID);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uloc_getLCID' -Namespace Win32 -PassThru
# $api::uloc_getLCID(localeID)#uselib "icuuc.dll"
#func global uloc_getLCID "uloc_getLCID" sptr
; uloc_getLCID localeID ; 戻り値は stat
; localeID : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuuc.dll"
#cfunc global uloc_getLCID "uloc_getLCID" str
; res = uloc_getLCID(localeID)
; localeID : LPCSTR -> "str"; DWORD uloc_getLCID(LPCSTR localeID)
#uselib "icuuc.dll"
#cfunc global uloc_getLCID "uloc_getLCID" str
; res = uloc_getLCID(localeID)
; localeID : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
proculoc_getLCID = icuuc.NewProc("uloc_getLCID")
)
// localeID (LPCSTR)
r1, _, err := proculoc_getLCID.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(localeID))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction uloc_getLCID(
localeID: PAnsiChar // LPCSTR
): DWORD; cdecl;
external 'icuuc.dll' name 'uloc_getLCID';result := DllCall("icuuc\uloc_getLCID"
, "AStr", localeID ; LPCSTR
, "Cdecl UInt") ; return: DWORD●uloc_getLCID(localeID) = DLL("icuuc.dll", "dword uloc_getLCID(char*)")
# 呼び出し: uloc_getLCID(localeID)
# localeID : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。