ホーム › System.AddressBook › FPropCompareProp
FPropCompareProp
関数二つのプロパティ値を指定の関係演算子で比較する。
シグネチャ
// MAPI32.dll
#include <windows.h>
BOOL FPropCompareProp(
SPropValue* lpSPropValue1,
DWORD ulRelOp,
SPropValue* lpSPropValue2
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpSPropValue1 | SPropValue* | inout |
| ulRelOp | DWORD | in |
| lpSPropValue2 | SPropValue* | inout |
戻り値の型: BOOL
各言語での呼び出し定義
// MAPI32.dll
#include <windows.h>
BOOL FPropCompareProp(
SPropValue* lpSPropValue1,
DWORD ulRelOp,
SPropValue* lpSPropValue2
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern bool FPropCompareProp(
IntPtr lpSPropValue1, // SPropValue* in/out
uint ulRelOp, // DWORD
IntPtr lpSPropValue2 // SPropValue* in/out
);<DllImport("MAPI32.dll", ExactSpelling:=True)>
Public Shared Function FPropCompareProp(
lpSPropValue1 As IntPtr, ' SPropValue* in/out
ulRelOp As UInteger, ' DWORD
lpSPropValue2 As IntPtr ' SPropValue* in/out
) As Boolean
End Function' lpSPropValue1 : SPropValue* in/out
' ulRelOp : DWORD
' lpSPropValue2 : SPropValue* in/out
Declare PtrSafe Function FPropCompareProp Lib "mapi32" ( _
ByVal lpSPropValue1 As LongPtr, _
ByVal ulRelOp As Long, _
ByVal lpSPropValue2 As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
FPropCompareProp = ctypes.windll.mapi32.FPropCompareProp
FPropCompareProp.restype = wintypes.BOOL
FPropCompareProp.argtypes = [
ctypes.c_void_p, # lpSPropValue1 : SPropValue* in/out
wintypes.DWORD, # ulRelOp : DWORD
ctypes.c_void_p, # lpSPropValue2 : SPropValue* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MAPI32.dll')
FPropCompareProp = Fiddle::Function.new(
lib['FPropCompareProp'],
[
Fiddle::TYPE_VOIDP, # lpSPropValue1 : SPropValue* in/out
-Fiddle::TYPE_INT, # ulRelOp : DWORD
Fiddle::TYPE_VOIDP, # lpSPropValue2 : SPropValue* in/out
],
Fiddle::TYPE_INT)#[link(name = "mapi32")]
extern "system" {
fn FPropCompareProp(
lpSPropValue1: *mut SPropValue, // SPropValue* in/out
ulRelOp: u32, // DWORD
lpSPropValue2: *mut SPropValue // SPropValue* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("MAPI32.dll")]
public static extern bool FPropCompareProp(IntPtr lpSPropValue1, uint ulRelOp, IntPtr lpSPropValue2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_FPropCompareProp' -Namespace Win32 -PassThru
# $api::FPropCompareProp(lpSPropValue1, ulRelOp, lpSPropValue2)#uselib "MAPI32.dll"
#func global FPropCompareProp "FPropCompareProp" sptr, sptr, sptr
; FPropCompareProp varptr(lpSPropValue1), ulRelOp, varptr(lpSPropValue2) ; 戻り値は stat
; lpSPropValue1 : SPropValue* in/out -> "sptr"
; ulRelOp : DWORD -> "sptr"
; lpSPropValue2 : SPropValue* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MAPI32.dll" #cfunc global FPropCompareProp "FPropCompareProp" var, int, var ; res = FPropCompareProp(lpSPropValue1, ulRelOp, lpSPropValue2) ; lpSPropValue1 : SPropValue* in/out -> "var" ; ulRelOp : DWORD -> "int" ; lpSPropValue2 : SPropValue* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MAPI32.dll" #cfunc global FPropCompareProp "FPropCompareProp" sptr, int, sptr ; res = FPropCompareProp(varptr(lpSPropValue1), ulRelOp, varptr(lpSPropValue2)) ; lpSPropValue1 : SPropValue* in/out -> "sptr" ; ulRelOp : DWORD -> "int" ; lpSPropValue2 : SPropValue* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL FPropCompareProp(SPropValue* lpSPropValue1, DWORD ulRelOp, SPropValue* lpSPropValue2) #uselib "MAPI32.dll" #cfunc global FPropCompareProp "FPropCompareProp" var, int, var ; res = FPropCompareProp(lpSPropValue1, ulRelOp, lpSPropValue2) ; lpSPropValue1 : SPropValue* in/out -> "var" ; ulRelOp : DWORD -> "int" ; lpSPropValue2 : SPropValue* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL FPropCompareProp(SPropValue* lpSPropValue1, DWORD ulRelOp, SPropValue* lpSPropValue2) #uselib "MAPI32.dll" #cfunc global FPropCompareProp "FPropCompareProp" intptr, int, intptr ; res = FPropCompareProp(varptr(lpSPropValue1), ulRelOp, varptr(lpSPropValue2)) ; lpSPropValue1 : SPropValue* in/out -> "intptr" ; ulRelOp : DWORD -> "int" ; lpSPropValue2 : SPropValue* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
procFPropCompareProp = mapi32.NewProc("FPropCompareProp")
)
// lpSPropValue1 (SPropValue* in/out), ulRelOp (DWORD), lpSPropValue2 (SPropValue* in/out)
r1, _, err := procFPropCompareProp.Call(
uintptr(lpSPropValue1),
uintptr(ulRelOp),
uintptr(lpSPropValue2),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction FPropCompareProp(
lpSPropValue1: Pointer; // SPropValue* in/out
ulRelOp: DWORD; // DWORD
lpSPropValue2: Pointer // SPropValue* in/out
): BOOL; stdcall;
external 'MAPI32.dll' name 'FPropCompareProp';result := DllCall("MAPI32\FPropCompareProp"
, "Ptr", lpSPropValue1 ; SPropValue* in/out
, "UInt", ulRelOp ; DWORD
, "Ptr", lpSPropValue2 ; SPropValue* in/out
, "Int") ; return: BOOL●FPropCompareProp(lpSPropValue1, ulRelOp, lpSPropValue2) = DLL("MAPI32.dll", "bool FPropCompareProp(void*, dword, void*)")
# 呼び出し: FPropCompareProp(lpSPropValue1, ulRelOp, lpSPropValue2)
# lpSPropValue1 : SPropValue* in/out -> "void*"
# ulRelOp : DWORD -> "dword"
# lpSPropValue2 : SPropValue* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。