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

utext_nativeLength

関数
UTextのネイティブ単位での長さを取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

LONGLONG utext_nativeLength(
    UText* ut
);

パラメーター

名前方向
utUText*inout

戻り値の型: LONGLONG

各言語での呼び出し定義

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

LONGLONG utext_nativeLength(
    UText* ut
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern long utext_nativeLength(
    IntPtr ut   // UText* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function utext_nativeLength(
    ut As IntPtr   ' UText* in/out
) As Long
End Function
' ut : UText* in/out
Declare PtrSafe Function utext_nativeLength Lib "icuuc" ( _
    ByVal ut As LongPtr) As LongLong
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

utext_nativeLength = ctypes.cdll.icuuc.utext_nativeLength
utext_nativeLength.restype = ctypes.c_longlong
utext_nativeLength.argtypes = [
    ctypes.c_void_p,  # ut : UText* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
utext_nativeLength = Fiddle::Function.new(
  lib['utext_nativeLength'],
  [
    Fiddle::TYPE_VOIDP,  # ut : UText* in/out
  ],
  Fiddle::TYPE_LONG_LONG, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn utext_nativeLength(
        ut: *mut UText  // UText* in/out
    ) -> i64;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern long utext_nativeLength(IntPtr ut);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_utext_nativeLength' -Namespace Win32 -PassThru
# $api::utext_nativeLength(ut)
#uselib "icuuc.dll"
#func global utext_nativeLength "utext_nativeLength" sptr
; utext_nativeLength varptr(ut)   ; 戻り値は stat
; ut : UText* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuuc.dll"
#cfunc global utext_nativeLength "utext_nativeLength" var
; res = utext_nativeLength(ut)
; ut : UText* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; LONGLONG utext_nativeLength(UText* ut)
#uselib "icuuc.dll"
#cfunc global utext_nativeLength "utext_nativeLength" var
; res = utext_nativeLength(ut)
; ut : UText* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procutext_nativeLength = icuuc.NewProc("utext_nativeLength")
)

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