ホーム › System.Ole › VarUI8FromI2
VarUI8FromI2
関数符号付き2バイト整数を符号なし8バイト整数に変換する。
シグネチャ
// OLEAUT32.dll
#include <windows.h>
HRESULT VarUI8FromI2(
SHORT sIn,
ULONGLONG* pi64Out
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| sIn | SHORT | in |
| pi64Out | ULONGLONG* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// OLEAUT32.dll
#include <windows.h>
HRESULT VarUI8FromI2(
SHORT sIn,
ULONGLONG* pi64Out
);[DllImport("OLEAUT32.dll", ExactSpelling = true)]
static extern int VarUI8FromI2(
short sIn, // SHORT
out ulong pi64Out // ULONGLONG* out
);<DllImport("OLEAUT32.dll", ExactSpelling:=True)>
Public Shared Function VarUI8FromI2(
sIn As Short, ' SHORT
<Out> ByRef pi64Out As ULong ' ULONGLONG* out
) As Integer
End Function' sIn : SHORT
' pi64Out : ULONGLONG* out
Declare PtrSafe Function VarUI8FromI2 Lib "oleaut32" ( _
ByVal sIn As Integer, _
ByRef pi64Out As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
VarUI8FromI2 = ctypes.windll.oleaut32.VarUI8FromI2
VarUI8FromI2.restype = ctypes.c_int
VarUI8FromI2.argtypes = [
ctypes.c_short, # sIn : SHORT
ctypes.POINTER(ctypes.c_ulonglong), # pi64Out : ULONGLONG* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLEAUT32.dll')
VarUI8FromI2 = Fiddle::Function.new(
lib['VarUI8FromI2'],
[
Fiddle::TYPE_SHORT, # sIn : SHORT
Fiddle::TYPE_VOIDP, # pi64Out : ULONGLONG* out
],
Fiddle::TYPE_INT)#[link(name = "oleaut32")]
extern "system" {
fn VarUI8FromI2(
sIn: i16, // SHORT
pi64Out: *mut u64 // ULONGLONG* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLEAUT32.dll")]
public static extern int VarUI8FromI2(short sIn, out ulong pi64Out);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEAUT32_VarUI8FromI2' -Namespace Win32 -PassThru
# $api::VarUI8FromI2(sIn, pi64Out)#uselib "OLEAUT32.dll"
#func global VarUI8FromI2 "VarUI8FromI2" sptr, sptr
; VarUI8FromI2 sIn, varptr(pi64Out) ; 戻り値は stat
; sIn : SHORT -> "sptr"
; pi64Out : ULONGLONG* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "OLEAUT32.dll" #cfunc global VarUI8FromI2 "VarUI8FromI2" int, var ; res = VarUI8FromI2(sIn, pi64Out) ; sIn : SHORT -> "int" ; pi64Out : ULONGLONG* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "OLEAUT32.dll" #cfunc global VarUI8FromI2 "VarUI8FromI2" int, sptr ; res = VarUI8FromI2(sIn, varptr(pi64Out)) ; sIn : SHORT -> "int" ; pi64Out : ULONGLONG* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT VarUI8FromI2(SHORT sIn, ULONGLONG* pi64Out) #uselib "OLEAUT32.dll" #cfunc global VarUI8FromI2 "VarUI8FromI2" int, var ; res = VarUI8FromI2(sIn, pi64Out) ; sIn : SHORT -> "int" ; pi64Out : ULONGLONG* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT VarUI8FromI2(SHORT sIn, ULONGLONG* pi64Out) #uselib "OLEAUT32.dll" #cfunc global VarUI8FromI2 "VarUI8FromI2" int, intptr ; res = VarUI8FromI2(sIn, varptr(pi64Out)) ; sIn : SHORT -> "int" ; pi64Out : ULONGLONG* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
oleaut32 = windows.NewLazySystemDLL("OLEAUT32.dll")
procVarUI8FromI2 = oleaut32.NewProc("VarUI8FromI2")
)
// sIn (SHORT), pi64Out (ULONGLONG* out)
r1, _, err := procVarUI8FromI2.Call(
uintptr(sIn),
uintptr(pi64Out),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction VarUI8FromI2(
sIn: Smallint; // SHORT
pi64Out: Pointer // ULONGLONG* out
): Integer; stdcall;
external 'OLEAUT32.dll' name 'VarUI8FromI2';result := DllCall("OLEAUT32\VarUI8FromI2"
, "Short", sIn ; SHORT
, "Ptr", pi64Out ; ULONGLONG* out
, "Int") ; return: HRESULT●VarUI8FromI2(sIn, pi64Out) = DLL("OLEAUT32.dll", "int VarUI8FromI2(int, void*)")
# 呼び出し: VarUI8FromI2(sIn, pi64Out)
# sIn : SHORT -> "int"
# pi64Out : ULONGLONG* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。