ホーム › Devices.AllJoyn › alljoyn_interfacedescription_hasmember
alljoyn_interfacedescription_hasmember
関数指定名とシグネチャのメンバーが存在するか判定する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
INT alljoyn_interfacedescription_hasmember(
alljoyn_interfacedescription iface,
LPCSTR name,
LPCSTR inSig,
LPCSTR outSig
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| iface | alljoyn_interfacedescription | in |
| name | LPCSTR | in |
| inSig | LPCSTR | in |
| outSig | LPCSTR | in |
戻り値の型: INT
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
INT alljoyn_interfacedescription_hasmember(
alljoyn_interfacedescription iface,
LPCSTR name,
LPCSTR inSig,
LPCSTR outSig
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_interfacedescription_hasmember(
IntPtr iface, // alljoyn_interfacedescription
[MarshalAs(UnmanagedType.LPStr)] string name, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string inSig, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string outSig // LPCSTR
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_interfacedescription_hasmember(
iface As IntPtr, ' alljoyn_interfacedescription
<MarshalAs(UnmanagedType.LPStr)> name As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> inSig As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> outSig As String ' LPCSTR
) As Integer
End Function' iface : alljoyn_interfacedescription
' name : LPCSTR
' inSig : LPCSTR
' outSig : LPCSTR
Declare PtrSafe Function alljoyn_interfacedescription_hasmember Lib "msajapi" ( _
ByVal iface As LongPtr, _
ByVal name As String, _
ByVal inSig As String, _
ByVal outSig As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_interfacedescription_hasmember = ctypes.windll.msajapi.alljoyn_interfacedescription_hasmember
alljoyn_interfacedescription_hasmember.restype = ctypes.c_int
alljoyn_interfacedescription_hasmember.argtypes = [
ctypes.c_ssize_t, # iface : alljoyn_interfacedescription
wintypes.LPCSTR, # name : LPCSTR
wintypes.LPCSTR, # inSig : LPCSTR
wintypes.LPCSTR, # outSig : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_hasmember = Fiddle::Function.new(
lib['alljoyn_interfacedescription_hasmember'],
[
Fiddle::TYPE_INTPTR_T, # iface : alljoyn_interfacedescription
Fiddle::TYPE_VOIDP, # name : LPCSTR
Fiddle::TYPE_VOIDP, # inSig : LPCSTR
Fiddle::TYPE_VOIDP, # outSig : LPCSTR
],
Fiddle::TYPE_INT)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_interfacedescription_hasmember(
iface: isize, // alljoyn_interfacedescription
name: *const u8, // LPCSTR
inSig: *const u8, // LPCSTR
outSig: *const u8 // LPCSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern int alljoyn_interfacedescription_hasmember(IntPtr iface, [MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string inSig, [MarshalAs(UnmanagedType.LPStr)] string outSig);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_hasmember' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_hasmember(iface, name, inSig, outSig)#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_hasmember "alljoyn_interfacedescription_hasmember" sptr, sptr, sptr, sptr
; alljoyn_interfacedescription_hasmember iface, name, inSig, outSig ; 戻り値は stat
; iface : alljoyn_interfacedescription -> "sptr"
; name : LPCSTR -> "sptr"
; inSig : LPCSTR -> "sptr"
; outSig : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_hasmember "alljoyn_interfacedescription_hasmember" sptr, str, str, str
; res = alljoyn_interfacedescription_hasmember(iface, name, inSig, outSig)
; iface : alljoyn_interfacedescription -> "sptr"
; name : LPCSTR -> "str"
; inSig : LPCSTR -> "str"
; outSig : LPCSTR -> "str"; INT alljoyn_interfacedescription_hasmember(alljoyn_interfacedescription iface, LPCSTR name, LPCSTR inSig, LPCSTR outSig)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_hasmember "alljoyn_interfacedescription_hasmember" intptr, str, str, str
; res = alljoyn_interfacedescription_hasmember(iface, name, inSig, outSig)
; iface : alljoyn_interfacedescription -> "intptr"
; name : LPCSTR -> "str"
; inSig : LPCSTR -> "str"
; outSig : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_interfacedescription_hasmember = msajapi.NewProc("alljoyn_interfacedescription_hasmember")
)
// iface (alljoyn_interfacedescription), name (LPCSTR), inSig (LPCSTR), outSig (LPCSTR)
r1, _, err := procalljoyn_interfacedescription_hasmember.Call(
uintptr(iface),
uintptr(unsafe.Pointer(windows.BytePtrFromString(name))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(inSig))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(outSig))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction alljoyn_interfacedescription_hasmember(
iface: NativeInt; // alljoyn_interfacedescription
name: PAnsiChar; // LPCSTR
inSig: PAnsiChar; // LPCSTR
outSig: PAnsiChar // LPCSTR
): Integer; stdcall;
external 'MSAJApi.dll' name 'alljoyn_interfacedescription_hasmember';result := DllCall("MSAJApi\alljoyn_interfacedescription_hasmember"
, "Ptr", iface ; alljoyn_interfacedescription
, "AStr", name ; LPCSTR
, "AStr", inSig ; LPCSTR
, "AStr", outSig ; LPCSTR
, "Int") ; return: INT●alljoyn_interfacedescription_hasmember(iface, name, inSig, outSig) = DLL("MSAJApi.dll", "int alljoyn_interfacedescription_hasmember(int, char*, char*, char*)")
# 呼び出し: alljoyn_interfacedescription_hasmember(iface, name, inSig, outSig)
# iface : alljoyn_interfacedescription -> "int"
# name : LPCSTR -> "char*"
# inSig : LPCSTR -> "char*"
# outSig : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。