ホーム › System.Ole › VarCyCmp
VarCyCmp
関数2つの通貨型(CY)値を比較し大小関係を返す。
シグネチャ
// OLEAUT32.dll
#include <windows.h>
VARCMP VarCyCmp(
CY cyLeft,
CY cyRight
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| cyLeft | CY | in |
| cyRight | CY | in |
戻り値の型: VARCMP
各言語での呼び出し定義
// OLEAUT32.dll
#include <windows.h>
VARCMP VarCyCmp(
CY cyLeft,
CY cyRight
);[DllImport("OLEAUT32.dll", ExactSpelling = true)]
static extern uint VarCyCmp(
CY cyLeft, // CY
CY cyRight // CY
);<DllImport("OLEAUT32.dll", ExactSpelling:=True)>
Public Shared Function VarCyCmp(
cyLeft As CY, ' CY
cyRight As CY ' CY
) As UInteger
End Function' cyLeft : CY
' cyRight : CY
Declare PtrSafe Function VarCyCmp Lib "oleaut32" ( _
ByVal cyLeft As LongPtr, _
ByVal cyRight As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
VarCyCmp = ctypes.windll.oleaut32.VarCyCmp
VarCyCmp.restype = wintypes.DWORD
VarCyCmp.argtypes = [
CY, # cyLeft : CY
CY, # cyRight : CY
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLEAUT32.dll')
VarCyCmp = Fiddle::Function.new(
lib['VarCyCmp'],
[
Fiddle::TYPE_VOIDP, # cyLeft : CY
Fiddle::TYPE_VOIDP, # cyRight : CY
],
-Fiddle::TYPE_INT)#[link(name = "oleaut32")]
extern "system" {
fn VarCyCmp(
cyLeft: CY, // CY
cyRight: CY // CY
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLEAUT32.dll")]
public static extern uint VarCyCmp(CY cyLeft, CY cyRight);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEAUT32_VarCyCmp' -Namespace Win32 -PassThru
# $api::VarCyCmp(cyLeft, cyRight)#uselib "OLEAUT32.dll"
#func global VarCyCmp "VarCyCmp" sptr, sptr
; VarCyCmp cyLeft, cyRight ; 戻り値は stat
; cyLeft : CY -> "sptr"
; cyRight : CY -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "OLEAUT32.dll"
#cfunc global VarCyCmp "VarCyCmp" int, int
; res = VarCyCmp(cyLeft, cyRight)
; cyLeft : CY -> "int"
; cyRight : CY -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。; VARCMP VarCyCmp(CY cyLeft, CY cyRight)
#uselib "OLEAUT32.dll"
#cfunc global VarCyCmp "VarCyCmp" int, int
; res = VarCyCmp(cyLeft, cyRight)
; cyLeft : CY -> "int"
; cyRight : CY -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
oleaut32 = windows.NewLazySystemDLL("OLEAUT32.dll")
procVarCyCmp = oleaut32.NewProc("VarCyCmp")
)
// cyLeft (CY), cyRight (CY)
r1, _, err := procVarCyCmp.Call(
uintptr(cyLeft),
uintptr(cyRight),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // VARCMPfunction VarCyCmp(
cyLeft: CY; // CY
cyRight: CY // CY
): DWORD; stdcall;
external 'OLEAUT32.dll' name 'VarCyCmp';result := DllCall("OLEAUT32\VarCyCmp"
, "Ptr", cyLeft ; CY
, "Ptr", cyRight ; CY
, "UInt") ; return: VARCMP●VarCyCmp(cyLeft, cyRight) = DLL("OLEAUT32.dll", "dword VarCyCmp(void*, void*)")
# 呼び出し: VarCyCmp(cyLeft, cyRight)
# cyLeft : CY -> "void*"
# cyRight : CY -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。