ホーム › Globalization › ucal_getNow
ucal_getNow
関数現在時刻をUTCのミリ秒として取得する。
シグネチャ
// icuin.dll
#include <windows.h>
DOUBLE ucal_getNow(void);パラメーターなし。戻り値: DOUBLE
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
DOUBLE ucal_getNow(void);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern double ucal_getNow();<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucal_getNow() As Double
End FunctionDeclare PtrSafe Function ucal_getNow Lib "icuin" () As Double
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucal_getNow = ctypes.cdll.icuin.ucal_getNow
ucal_getNow.restype = ctypes.c_double
ucal_getNow.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
ucal_getNow = Fiddle::Function.new(
lib['ucal_getNow'],
[],
Fiddle::TYPE_DOUBLE, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn ucal_getNow() -> f64;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern double ucal_getNow();
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucal_getNow' -Namespace Win32 -PassThru
# $api::ucal_getNow()#uselib "icuin.dll"
#func global ucal_getNow "ucal_getNow"
; ucal_getNow ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuin.dll"
#cfunc global ucal_getNow "ucal_getNow"
; res = ucal_getNow(); DOUBLE ucal_getNow()
#uselib "icuin.dll"
#cfunc global ucal_getNow "ucal_getNow"
; res = ucal_getNow()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procucal_getNow = icuin.NewProc("ucal_getNow")
)
r1, _, err := procucal_getNow.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DOUBLEfunction ucal_getNow: Double; cdecl;
external 'icuin.dll' name 'ucal_getNow';result := DllCall("icuin\ucal_getNow", "Cdecl Double")●ucal_getNow() = DLL("icuin.dll", "double ucal_getNow()")
# 呼び出し: ucal_getNow()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。