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

utext_getNativeIndex

関数
UTextの現在のネイティブ位置を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

LONGLONG utext_getNativeIndex(
    const UText* ut
);

パラメーター

名前方向
utUText*in

戻り値の型: LONGLONG

各言語での呼び出し定義

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

LONGLONG utext_getNativeIndex(
    const UText* ut
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern long utext_getNativeIndex(
    IntPtr ut   // UText*
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function utext_getNativeIndex(
    ut As IntPtr   ' UText*
) As Long
End Function
' ut : UText*
Declare PtrSafe Function utext_getNativeIndex 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_getNativeIndex = ctypes.cdll.icuuc.utext_getNativeIndex
utext_getNativeIndex.restype = ctypes.c_longlong
utext_getNativeIndex.argtypes = [
    ctypes.c_void_p,  # ut : UText*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procutext_getNativeIndex = icuuc.NewProc("utext_getNativeIndex")
)

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