ホーム › Devices.AllJoyn › AllJoynConnectToBus
AllJoynConnectToBus
関数AllJoynのメッセージバスに接続する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
HANDLE AllJoynConnectToBus(
LPCWSTR connectionSpec // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| connectionSpec | LPCWSTR | inoptional |
戻り値の型: HANDLE
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
HANDLE AllJoynConnectToBus(
LPCWSTR connectionSpec // optional
);[DllImport("MSAJApi.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr AllJoynConnectToBus(
[MarshalAs(UnmanagedType.LPWStr)] string connectionSpec // LPCWSTR optional
);<DllImport("MSAJApi.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function AllJoynConnectToBus(
<MarshalAs(UnmanagedType.LPWStr)> connectionSpec As String ' LPCWSTR optional
) As IntPtr
End Function' connectionSpec : LPCWSTR optional
Declare PtrSafe Function AllJoynConnectToBus Lib "msajapi" ( _
ByVal connectionSpec As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AllJoynConnectToBus = ctypes.windll.msajapi.AllJoynConnectToBus
AllJoynConnectToBus.restype = ctypes.c_void_p
AllJoynConnectToBus.argtypes = [
wintypes.LPCWSTR, # connectionSpec : LPCWSTR optional
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
AllJoynConnectToBus = Fiddle::Function.new(
lib['AllJoynConnectToBus'],
[
Fiddle::TYPE_VOIDP, # connectionSpec : LPCWSTR optional
],
Fiddle::TYPE_VOIDP)#[link(name = "msajapi")]
extern "system" {
fn AllJoynConnectToBus(
connectionSpec: *const u16 // LPCWSTR optional
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll", SetLastError = true)]
public static extern IntPtr AllJoynConnectToBus([MarshalAs(UnmanagedType.LPWStr)] string connectionSpec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_AllJoynConnectToBus' -Namespace Win32 -PassThru
# $api::AllJoynConnectToBus(connectionSpec)#uselib "MSAJApi.dll"
#func global AllJoynConnectToBus "AllJoynConnectToBus" sptr
; AllJoynConnectToBus connectionSpec ; 戻り値は stat
; connectionSpec : LPCWSTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSAJApi.dll"
#cfunc global AllJoynConnectToBus "AllJoynConnectToBus" wstr
; res = AllJoynConnectToBus(connectionSpec)
; connectionSpec : LPCWSTR optional -> "wstr"; HANDLE AllJoynConnectToBus(LPCWSTR connectionSpec)
#uselib "MSAJApi.dll"
#cfunc global AllJoynConnectToBus "AllJoynConnectToBus" wstr
; res = AllJoynConnectToBus(connectionSpec)
; connectionSpec : LPCWSTR optional -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procAllJoynConnectToBus = msajapi.NewProc("AllJoynConnectToBus")
)
// connectionSpec (LPCWSTR optional)
r1, _, err := procAllJoynConnectToBus.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(connectionSpec))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HANDLEfunction AllJoynConnectToBus(
connectionSpec: PWideChar // LPCWSTR optional
): THandle; stdcall;
external 'MSAJApi.dll' name 'AllJoynConnectToBus';result := DllCall("MSAJApi\AllJoynConnectToBus"
, "WStr", connectionSpec ; LPCWSTR optional
, "Ptr") ; return: HANDLE●AllJoynConnectToBus(connectionSpec) = DLL("MSAJApi.dll", "void* AllJoynConnectToBus(char*)")
# 呼び出し: AllJoynConnectToBus(connectionSpec)
# connectionSpec : LPCWSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。