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