ホーム › Globalization › unum_setDoubleAttribute
unum_setDoubleAttribute
関数数値フォーマッタの倍精度属性値を設定する。
シグネチャ
// icuin.dll
#include <windows.h>
void unum_setDoubleAttribute(
void** fmt,
UNumberFormatAttribute attr,
DOUBLE newValue
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| fmt | void** | inout |
| attr | UNumberFormatAttribute | in |
| newValue | DOUBLE | in |
戻り値の型: void
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
void unum_setDoubleAttribute(
void** fmt,
UNumberFormatAttribute attr,
DOUBLE newValue
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void unum_setDoubleAttribute(
IntPtr fmt, // void** in/out
int attr, // UNumberFormatAttribute
double newValue // DOUBLE
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub unum_setDoubleAttribute(
fmt As IntPtr, ' void** in/out
attr As Integer, ' UNumberFormatAttribute
newValue As Double ' DOUBLE
)
End Sub' fmt : void** in/out
' attr : UNumberFormatAttribute
' newValue : DOUBLE
Declare PtrSafe Sub unum_setDoubleAttribute Lib "icuin" ( _
ByVal fmt As LongPtr, _
ByVal attr As Long, _
ByVal newValue As Double)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
unum_setDoubleAttribute = ctypes.cdll.icuin.unum_setDoubleAttribute
unum_setDoubleAttribute.restype = None
unum_setDoubleAttribute.argtypes = [
ctypes.c_void_p, # fmt : void** in/out
ctypes.c_int, # attr : UNumberFormatAttribute
ctypes.c_double, # newValue : DOUBLE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
unum_setDoubleAttribute = Fiddle::Function.new(
lib['unum_setDoubleAttribute'],
[
Fiddle::TYPE_VOIDP, # fmt : void** in/out
Fiddle::TYPE_INT, # attr : UNumberFormatAttribute
Fiddle::TYPE_DOUBLE, # newValue : DOUBLE
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn unum_setDoubleAttribute(
fmt: *mut *mut (), // void** in/out
attr: i32, // UNumberFormatAttribute
newValue: f64 // DOUBLE
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void unum_setDoubleAttribute(IntPtr fmt, int attr, double newValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_unum_setDoubleAttribute' -Namespace Win32 -PassThru
# $api::unum_setDoubleAttribute(fmt, attr, newValue)#uselib "icuin.dll"
#func global unum_setDoubleAttribute "unum_setDoubleAttribute" sptr, sptr, double
; unum_setDoubleAttribute fmt, attr, newValue
; fmt : void** in/out -> "sptr"
; attr : UNumberFormatAttribute -> "sptr"
; newValue : DOUBLE -> "double"#uselib "icuin.dll"
#func global unum_setDoubleAttribute "unum_setDoubleAttribute" sptr, int, double
; unum_setDoubleAttribute fmt, attr, newValue
; fmt : void** in/out -> "sptr"
; attr : UNumberFormatAttribute -> "int"
; newValue : DOUBLE -> "double"; void unum_setDoubleAttribute(void** fmt, UNumberFormatAttribute attr, DOUBLE newValue)
#uselib "icuin.dll"
#func global unum_setDoubleAttribute "unum_setDoubleAttribute" intptr, int, double
; unum_setDoubleAttribute fmt, attr, newValue
; fmt : void** in/out -> "intptr"
; attr : UNumberFormatAttribute -> "int"
; newValue : DOUBLE -> "double"import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procunum_setDoubleAttribute = icuin.NewProc("unum_setDoubleAttribute")
)
// fmt (void** in/out), attr (UNumberFormatAttribute), newValue (DOUBLE)
r1, _, err := procunum_setDoubleAttribute.Call(
uintptr(fmt),
uintptr(attr),
uintptr(math.Float64bits(newValue)),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // void
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。procedure unum_setDoubleAttribute(
fmt: Pointer; // void** in/out
attr: Integer; // UNumberFormatAttribute
newValue: Double // DOUBLE
); cdecl;
external 'icuin.dll' name 'unum_setDoubleAttribute';result := DllCall("icuin\unum_setDoubleAttribute"
, "Ptr", fmt ; void** in/out
, "Int", attr ; UNumberFormatAttribute
, "Double", newValue ; DOUBLE
, "Cdecl Int") ; return: void●unum_setDoubleAttribute(fmt, attr, newValue) = DLL("icuin.dll", "int unum_setDoubleAttribute(void*, int, double)")
# 呼び出し: unum_setDoubleAttribute(fmt, attr, newValue)
# fmt : void** in/out -> "void*"
# attr : UNumberFormatAttribute -> "int"
# newValue : DOUBLE -> "double"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。