Win32 API 日本語リファレンス
ホームDevices.AllJoyn › alljoyn_interfacedescription_addmember

alljoyn_interfacedescription_addmember

関数
インターフェイス記述にメソッドやシグナルのメンバーを追加する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_interfacedescription_addmember(
    alljoyn_interfacedescription iface,
    alljoyn_messagetype type,
    LPCSTR name,
    LPCSTR inputSig,
    LPCSTR outSig,
    LPCSTR argNames,
    BYTE annotation
);

パラメーター

名前方向
ifacealljoyn_interfacedescriptionin
typealljoyn_messagetypein
nameLPCSTRin
inputSigLPCSTRin
outSigLPCSTRin
argNamesLPCSTRin
annotationBYTEin

戻り値の型: QStatus

各言語での呼び出し定義

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

QStatus alljoyn_interfacedescription_addmember(
    alljoyn_interfacedescription iface,
    alljoyn_messagetype type,
    LPCSTR name,
    LPCSTR inputSig,
    LPCSTR outSig,
    LPCSTR argNames,
    BYTE annotation
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_interfacedescription_addmember(
    IntPtr iface,   // alljoyn_interfacedescription
    int type,   // alljoyn_messagetype
    [MarshalAs(UnmanagedType.LPStr)] string name,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string inputSig,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string outSig,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string argNames,   // LPCSTR
    byte annotation   // BYTE
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_interfacedescription_addmember(
    iface As IntPtr,   ' alljoyn_interfacedescription
    type As Integer,   ' alljoyn_messagetype
    <MarshalAs(UnmanagedType.LPStr)> name As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> inputSig As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> outSig As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> argNames As String,   ' LPCSTR
    annotation As Byte   ' BYTE
) As Integer
End Function
' iface : alljoyn_interfacedescription
' type : alljoyn_messagetype
' name : LPCSTR
' inputSig : LPCSTR
' outSig : LPCSTR
' argNames : LPCSTR
' annotation : BYTE
Declare PtrSafe Function alljoyn_interfacedescription_addmember Lib "msajapi" ( _
    ByVal iface As LongPtr, _
    ByVal type As Long, _
    ByVal name As String, _
    ByVal inputSig As String, _
    ByVal outSig As String, _
    ByVal argNames As String, _
    ByVal annotation As Byte) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_interfacedescription_addmember = ctypes.windll.msajapi.alljoyn_interfacedescription_addmember
alljoyn_interfacedescription_addmember.restype = ctypes.c_int
alljoyn_interfacedescription_addmember.argtypes = [
    ctypes.c_ssize_t,  # iface : alljoyn_interfacedescription
    ctypes.c_int,  # type : alljoyn_messagetype
    wintypes.LPCSTR,  # name : LPCSTR
    wintypes.LPCSTR,  # inputSig : LPCSTR
    wintypes.LPCSTR,  # outSig : LPCSTR
    wintypes.LPCSTR,  # argNames : LPCSTR
    ctypes.c_ubyte,  # annotation : BYTE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_addmember = Fiddle::Function.new(
  lib['alljoyn_interfacedescription_addmember'],
  [
    Fiddle::TYPE_INTPTR_T,  # iface : alljoyn_interfacedescription
    Fiddle::TYPE_INT,  # type : alljoyn_messagetype
    Fiddle::TYPE_VOIDP,  # name : LPCSTR
    Fiddle::TYPE_VOIDP,  # inputSig : LPCSTR
    Fiddle::TYPE_VOIDP,  # outSig : LPCSTR
    Fiddle::TYPE_VOIDP,  # argNames : LPCSTR
    -Fiddle::TYPE_CHAR,  # annotation : BYTE
  ],
  Fiddle::TYPE_INT)
#[link(name = "msajapi")]
extern "system" {
    fn alljoyn_interfacedescription_addmember(
        iface: isize,  // alljoyn_interfacedescription
        type: i32,  // alljoyn_messagetype
        name: *const u8,  // LPCSTR
        inputSig: *const u8,  // LPCSTR
        outSig: *const u8,  // LPCSTR
        argNames: *const u8,  // LPCSTR
        annotation: u8  // BYTE
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSAJApi.dll")]
public static extern int alljoyn_interfacedescription_addmember(IntPtr iface, int type, [MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string inputSig, [MarshalAs(UnmanagedType.LPStr)] string outSig, [MarshalAs(UnmanagedType.LPStr)] string argNames, byte annotation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_addmember' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_addmember(iface, type, name, inputSig, outSig, argNames, annotation)
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_addmember "alljoyn_interfacedescription_addmember" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; alljoyn_interfacedescription_addmember iface, type, name, inputSig, outSig, argNames, annotation   ; 戻り値は stat
; iface : alljoyn_interfacedescription -> "sptr"
; type : alljoyn_messagetype -> "sptr"
; name : LPCSTR -> "sptr"
; inputSig : LPCSTR -> "sptr"
; outSig : LPCSTR -> "sptr"
; argNames : LPCSTR -> "sptr"
; annotation : BYTE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_addmember "alljoyn_interfacedescription_addmember" sptr, int, str, str, str, str, int
; res = alljoyn_interfacedescription_addmember(iface, type, name, inputSig, outSig, argNames, annotation)
; iface : alljoyn_interfacedescription -> "sptr"
; type : alljoyn_messagetype -> "int"
; name : LPCSTR -> "str"
; inputSig : LPCSTR -> "str"
; outSig : LPCSTR -> "str"
; argNames : LPCSTR -> "str"
; annotation : BYTE -> "int"
; QStatus alljoyn_interfacedescription_addmember(alljoyn_interfacedescription iface, alljoyn_messagetype type, LPCSTR name, LPCSTR inputSig, LPCSTR outSig, LPCSTR argNames, BYTE annotation)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_addmember "alljoyn_interfacedescription_addmember" intptr, int, str, str, str, str, int
; res = alljoyn_interfacedescription_addmember(iface, type, name, inputSig, outSig, argNames, annotation)
; iface : alljoyn_interfacedescription -> "intptr"
; type : alljoyn_messagetype -> "int"
; name : LPCSTR -> "str"
; inputSig : LPCSTR -> "str"
; outSig : LPCSTR -> "str"
; argNames : LPCSTR -> "str"
; annotation : BYTE -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_interfacedescription_addmember = msajapi.NewProc("alljoyn_interfacedescription_addmember")
)

// iface (alljoyn_interfacedescription), type (alljoyn_messagetype), name (LPCSTR), inputSig (LPCSTR), outSig (LPCSTR), argNames (LPCSTR), annotation (BYTE)
r1, _, err := procalljoyn_interfacedescription_addmember.Call(
	uintptr(iface),
	uintptr(type),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(name))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(inputSig))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(outSig))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(argNames))),
	uintptr(annotation),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // QStatus
function alljoyn_interfacedescription_addmember(
  iface: NativeInt;   // alljoyn_interfacedescription
  type: Integer;   // alljoyn_messagetype
  name: PAnsiChar;   // LPCSTR
  inputSig: PAnsiChar;   // LPCSTR
  outSig: PAnsiChar;   // LPCSTR
  argNames: PAnsiChar;   // LPCSTR
  annotation: Byte   // BYTE
): Integer; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_interfacedescription_addmember';
result := DllCall("MSAJApi\alljoyn_interfacedescription_addmember"
    , "Ptr", iface   ; alljoyn_interfacedescription
    , "Int", type   ; alljoyn_messagetype
    , "AStr", name   ; LPCSTR
    , "AStr", inputSig   ; LPCSTR
    , "AStr", outSig   ; LPCSTR
    , "AStr", argNames   ; LPCSTR
    , "UChar", annotation   ; BYTE
    , "Int")   ; return: QStatus
●alljoyn_interfacedescription_addmember(iface, type, name, inputSig, outSig, argNames, annotation) = DLL("MSAJApi.dll", "int alljoyn_interfacedescription_addmember(int, int, char*, char*, char*, char*, byte)")
# 呼び出し: alljoyn_interfacedescription_addmember(iface, type, name, inputSig, outSig, argNames, annotation)
# iface : alljoyn_interfacedescription -> "int"
# type : alljoyn_messagetype -> "int"
# name : LPCSTR -> "char*"
# inputSig : LPCSTR -> "char*"
# outSig : LPCSTR -> "char*"
# argNames : LPCSTR -> "char*"
# annotation : BYTE -> "byte"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。