ホーム › Devices.AllJoyn › alljoyn_proxybusobject_methodcallasync
alljoyn_proxybusobject_methodcallasync
関数リモートオブジェクトのメソッドを非同期呼出する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
QStatus alljoyn_proxybusobject_methodcallasync(
alljoyn_proxybusobject proxyObj,
LPCSTR ifaceName,
LPCSTR methodName,
alljoyn_messagereceiver_replyhandler_ptr replyFunc,
alljoyn_msgarg args,
UINT_PTR numArgs,
void* context,
DWORD timeout,
BYTE flags
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| proxyObj | alljoyn_proxybusobject | in |
| ifaceName | LPCSTR | in |
| methodName | LPCSTR | in |
| replyFunc | alljoyn_messagereceiver_replyhandler_ptr | in |
| args | alljoyn_msgarg | in |
| numArgs | UINT_PTR | in |
| context | void* | inout |
| timeout | DWORD | in |
| flags | BYTE | in |
戻り値の型: QStatus
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
QStatus alljoyn_proxybusobject_methodcallasync(
alljoyn_proxybusobject proxyObj,
LPCSTR ifaceName,
LPCSTR methodName,
alljoyn_messagereceiver_replyhandler_ptr replyFunc,
alljoyn_msgarg args,
UINT_PTR numArgs,
void* context,
DWORD timeout,
BYTE flags
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_proxybusobject_methodcallasync(
IntPtr proxyObj, // alljoyn_proxybusobject
[MarshalAs(UnmanagedType.LPStr)] string ifaceName, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string methodName, // LPCSTR
IntPtr replyFunc, // alljoyn_messagereceiver_replyhandler_ptr
IntPtr args, // alljoyn_msgarg
UIntPtr numArgs, // UINT_PTR
IntPtr context, // void* in/out
uint timeout, // DWORD
byte flags // BYTE
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_proxybusobject_methodcallasync(
proxyObj As IntPtr, ' alljoyn_proxybusobject
<MarshalAs(UnmanagedType.LPStr)> ifaceName As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> methodName As String, ' LPCSTR
replyFunc As IntPtr, ' alljoyn_messagereceiver_replyhandler_ptr
args As IntPtr, ' alljoyn_msgarg
numArgs As UIntPtr, ' UINT_PTR
context As IntPtr, ' void* in/out
timeout As UInteger, ' DWORD
flags As Byte ' BYTE
) As Integer
End Function' proxyObj : alljoyn_proxybusobject
' ifaceName : LPCSTR
' methodName : LPCSTR
' replyFunc : alljoyn_messagereceiver_replyhandler_ptr
' args : alljoyn_msgarg
' numArgs : UINT_PTR
' context : void* in/out
' timeout : DWORD
' flags : BYTE
Declare PtrSafe Function alljoyn_proxybusobject_methodcallasync Lib "msajapi" ( _
ByVal proxyObj As LongPtr, _
ByVal ifaceName As String, _
ByVal methodName As String, _
ByVal replyFunc As LongPtr, _
ByVal args As LongPtr, _
ByVal numArgs As LongPtr, _
ByVal context As LongPtr, _
ByVal timeout As Long, _
ByVal flags As Byte) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_proxybusobject_methodcallasync = ctypes.windll.msajapi.alljoyn_proxybusobject_methodcallasync
alljoyn_proxybusobject_methodcallasync.restype = ctypes.c_int
alljoyn_proxybusobject_methodcallasync.argtypes = [
ctypes.c_ssize_t, # proxyObj : alljoyn_proxybusobject
wintypes.LPCSTR, # ifaceName : LPCSTR
wintypes.LPCSTR, # methodName : LPCSTR
ctypes.c_void_p, # replyFunc : alljoyn_messagereceiver_replyhandler_ptr
ctypes.c_ssize_t, # args : alljoyn_msgarg
ctypes.c_size_t, # numArgs : UINT_PTR
ctypes.POINTER(None), # context : void* in/out
wintypes.DWORD, # timeout : DWORD
ctypes.c_ubyte, # flags : BYTE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_proxybusobject_methodcallasync = Fiddle::Function.new(
lib['alljoyn_proxybusobject_methodcallasync'],
[
Fiddle::TYPE_INTPTR_T, # proxyObj : alljoyn_proxybusobject
Fiddle::TYPE_VOIDP, # ifaceName : LPCSTR
Fiddle::TYPE_VOIDP, # methodName : LPCSTR
Fiddle::TYPE_VOIDP, # replyFunc : alljoyn_messagereceiver_replyhandler_ptr
Fiddle::TYPE_INTPTR_T, # args : alljoyn_msgarg
Fiddle::TYPE_UINTPTR_T, # numArgs : UINT_PTR
Fiddle::TYPE_VOIDP, # context : void* in/out
-Fiddle::TYPE_INT, # timeout : DWORD
-Fiddle::TYPE_CHAR, # flags : BYTE
],
Fiddle::TYPE_INT)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_proxybusobject_methodcallasync(
proxyObj: isize, // alljoyn_proxybusobject
ifaceName: *const u8, // LPCSTR
methodName: *const u8, // LPCSTR
replyFunc: *const core::ffi::c_void, // alljoyn_messagereceiver_replyhandler_ptr
args: isize, // alljoyn_msgarg
numArgs: usize, // UINT_PTR
context: *mut (), // void* in/out
timeout: u32, // DWORD
flags: u8 // BYTE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern int alljoyn_proxybusobject_methodcallasync(IntPtr proxyObj, [MarshalAs(UnmanagedType.LPStr)] string ifaceName, [MarshalAs(UnmanagedType.LPStr)] string methodName, IntPtr replyFunc, IntPtr args, UIntPtr numArgs, IntPtr context, uint timeout, byte flags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_proxybusobject_methodcallasync' -Namespace Win32 -PassThru
# $api::alljoyn_proxybusobject_methodcallasync(proxyObj, ifaceName, methodName, replyFunc, args, numArgs, context, timeout, flags)#uselib "MSAJApi.dll"
#func global alljoyn_proxybusobject_methodcallasync "alljoyn_proxybusobject_methodcallasync" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; alljoyn_proxybusobject_methodcallasync proxyObj, ifaceName, methodName, replyFunc, args, numArgs, context, timeout, flags ; 戻り値は stat
; proxyObj : alljoyn_proxybusobject -> "sptr"
; ifaceName : LPCSTR -> "sptr"
; methodName : LPCSTR -> "sptr"
; replyFunc : alljoyn_messagereceiver_replyhandler_ptr -> "sptr"
; args : alljoyn_msgarg -> "sptr"
; numArgs : UINT_PTR -> "sptr"
; context : void* in/out -> "sptr"
; timeout : DWORD -> "sptr"
; flags : BYTE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSAJApi.dll"
#cfunc global alljoyn_proxybusobject_methodcallasync "alljoyn_proxybusobject_methodcallasync" sptr, str, str, sptr, sptr, sptr, sptr, int, int
; res = alljoyn_proxybusobject_methodcallasync(proxyObj, ifaceName, methodName, replyFunc, args, numArgs, context, timeout, flags)
; proxyObj : alljoyn_proxybusobject -> "sptr"
; ifaceName : LPCSTR -> "str"
; methodName : LPCSTR -> "str"
; replyFunc : alljoyn_messagereceiver_replyhandler_ptr -> "sptr"
; args : alljoyn_msgarg -> "sptr"
; numArgs : UINT_PTR -> "sptr"
; context : void* in/out -> "sptr"
; timeout : DWORD -> "int"
; flags : BYTE -> "int"; QStatus alljoyn_proxybusobject_methodcallasync(alljoyn_proxybusobject proxyObj, LPCSTR ifaceName, LPCSTR methodName, alljoyn_messagereceiver_replyhandler_ptr replyFunc, alljoyn_msgarg args, UINT_PTR numArgs, void* context, DWORD timeout, BYTE flags)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_proxybusobject_methodcallasync "alljoyn_proxybusobject_methodcallasync" intptr, str, str, intptr, intptr, intptr, intptr, int, int
; res = alljoyn_proxybusobject_methodcallasync(proxyObj, ifaceName, methodName, replyFunc, args, numArgs, context, timeout, flags)
; proxyObj : alljoyn_proxybusobject -> "intptr"
; ifaceName : LPCSTR -> "str"
; methodName : LPCSTR -> "str"
; replyFunc : alljoyn_messagereceiver_replyhandler_ptr -> "intptr"
; args : alljoyn_msgarg -> "intptr"
; numArgs : UINT_PTR -> "intptr"
; context : void* in/out -> "intptr"
; timeout : DWORD -> "int"
; flags : BYTE -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_proxybusobject_methodcallasync = msajapi.NewProc("alljoyn_proxybusobject_methodcallasync")
)
// proxyObj (alljoyn_proxybusobject), ifaceName (LPCSTR), methodName (LPCSTR), replyFunc (alljoyn_messagereceiver_replyhandler_ptr), args (alljoyn_msgarg), numArgs (UINT_PTR), context (void* in/out), timeout (DWORD), flags (BYTE)
r1, _, err := procalljoyn_proxybusobject_methodcallasync.Call(
uintptr(proxyObj),
uintptr(unsafe.Pointer(windows.BytePtrFromString(ifaceName))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(methodName))),
uintptr(replyFunc),
uintptr(args),
uintptr(numArgs),
uintptr(context),
uintptr(timeout),
uintptr(flags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // QStatusfunction alljoyn_proxybusobject_methodcallasync(
proxyObj: NativeInt; // alljoyn_proxybusobject
ifaceName: PAnsiChar; // LPCSTR
methodName: PAnsiChar; // LPCSTR
replyFunc: Pointer; // alljoyn_messagereceiver_replyhandler_ptr
args: NativeInt; // alljoyn_msgarg
numArgs: NativeUInt; // UINT_PTR
context: Pointer; // void* in/out
timeout: DWORD; // DWORD
flags: Byte // BYTE
): Integer; stdcall;
external 'MSAJApi.dll' name 'alljoyn_proxybusobject_methodcallasync';result := DllCall("MSAJApi\alljoyn_proxybusobject_methodcallasync"
, "Ptr", proxyObj ; alljoyn_proxybusobject
, "AStr", ifaceName ; LPCSTR
, "AStr", methodName ; LPCSTR
, "Ptr", replyFunc ; alljoyn_messagereceiver_replyhandler_ptr
, "Ptr", args ; alljoyn_msgarg
, "UPtr", numArgs ; UINT_PTR
, "Ptr", context ; void* in/out
, "UInt", timeout ; DWORD
, "UChar", flags ; BYTE
, "Int") ; return: QStatus●alljoyn_proxybusobject_methodcallasync(proxyObj, ifaceName, methodName, replyFunc, args, numArgs, context, timeout, flags) = DLL("MSAJApi.dll", "int alljoyn_proxybusobject_methodcallasync(int, char*, char*, void*, int, int, void*, dword, byte)")
# 呼び出し: alljoyn_proxybusobject_methodcallasync(proxyObj, ifaceName, methodName, replyFunc, args, numArgs, context, timeout, flags)
# proxyObj : alljoyn_proxybusobject -> "int"
# ifaceName : LPCSTR -> "char*"
# methodName : LPCSTR -> "char*"
# replyFunc : alljoyn_messagereceiver_replyhandler_ptr -> "void*"
# args : alljoyn_msgarg -> "int"
# numArgs : UINT_PTR -> "int"
# context : void* in/out -> "void*"
# timeout : DWORD -> "dword"
# flags : BYTE -> "byte"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。