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