ホーム › Devices.Tapi › lineGetAgentCapsA
lineGetAgentCapsA
関数アドレスのACDエージェント機能や能力を取得する(ANSI版)。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineGetAgentCapsA(
DWORD hLineApp,
DWORD dwDeviceID,
DWORD dwAddressID,
DWORD dwAppAPIVersion,
LINEAGENTCAPS* lpAgentCaps
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hLineApp | DWORD | in |
| dwDeviceID | DWORD | in |
| dwAddressID | DWORD | in |
| dwAppAPIVersion | DWORD | in |
| lpAgentCaps | LINEAGENTCAPS* | inout |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineGetAgentCapsA(
DWORD hLineApp,
DWORD dwDeviceID,
DWORD dwAddressID,
DWORD dwAppAPIVersion,
LINEAGENTCAPS* lpAgentCaps
);[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineGetAgentCapsA(
uint hLineApp, // DWORD
uint dwDeviceID, // DWORD
uint dwAddressID, // DWORD
uint dwAppAPIVersion, // DWORD
IntPtr lpAgentCaps // LINEAGENTCAPS* in/out
);<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function lineGetAgentCapsA(
hLineApp As UInteger, ' DWORD
dwDeviceID As UInteger, ' DWORD
dwAddressID As UInteger, ' DWORD
dwAppAPIVersion As UInteger, ' DWORD
lpAgentCaps As IntPtr ' LINEAGENTCAPS* in/out
) As Integer
End Function' hLineApp : DWORD
' dwDeviceID : DWORD
' dwAddressID : DWORD
' dwAppAPIVersion : DWORD
' lpAgentCaps : LINEAGENTCAPS* in/out
Declare PtrSafe Function lineGetAgentCapsA Lib "tapi32" ( _
ByVal hLineApp As Long, _
ByVal dwDeviceID As Long, _
ByVal dwAddressID As Long, _
ByVal dwAppAPIVersion As Long, _
ByVal lpAgentCaps As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
lineGetAgentCapsA = ctypes.windll.tapi32.lineGetAgentCapsA
lineGetAgentCapsA.restype = ctypes.c_int
lineGetAgentCapsA.argtypes = [
wintypes.DWORD, # hLineApp : DWORD
wintypes.DWORD, # dwDeviceID : DWORD
wintypes.DWORD, # dwAddressID : DWORD
wintypes.DWORD, # dwAppAPIVersion : DWORD
ctypes.c_void_p, # lpAgentCaps : LINEAGENTCAPS* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
lineGetAgentCapsA = Fiddle::Function.new(
lib['lineGetAgentCapsA'],
[
-Fiddle::TYPE_INT, # hLineApp : DWORD
-Fiddle::TYPE_INT, # dwDeviceID : DWORD
-Fiddle::TYPE_INT, # dwAddressID : DWORD
-Fiddle::TYPE_INT, # dwAppAPIVersion : DWORD
Fiddle::TYPE_VOIDP, # lpAgentCaps : LINEAGENTCAPS* in/out
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn lineGetAgentCapsA(
hLineApp: u32, // DWORD
dwDeviceID: u32, // DWORD
dwAddressID: u32, // DWORD
dwAppAPIVersion: u32, // DWORD
lpAgentCaps: *mut LINEAGENTCAPS // LINEAGENTCAPS* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int lineGetAgentCapsA(uint hLineApp, uint dwDeviceID, uint dwAddressID, uint dwAppAPIVersion, IntPtr lpAgentCaps);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineGetAgentCapsA' -Namespace Win32 -PassThru
# $api::lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, lpAgentCaps)#uselib "TAPI32.dll"
#func global lineGetAgentCapsA "lineGetAgentCapsA" sptr, sptr, sptr, sptr, sptr
; lineGetAgentCapsA hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, varptr(lpAgentCaps) ; 戻り値は stat
; hLineApp : DWORD -> "sptr"
; dwDeviceID : DWORD -> "sptr"
; dwAddressID : DWORD -> "sptr"
; dwAppAPIVersion : DWORD -> "sptr"
; lpAgentCaps : LINEAGENTCAPS* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "TAPI32.dll" #cfunc global lineGetAgentCapsA "lineGetAgentCapsA" int, int, int, int, var ; res = lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, lpAgentCaps) ; hLineApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; dwAppAPIVersion : DWORD -> "int" ; lpAgentCaps : LINEAGENTCAPS* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "TAPI32.dll" #cfunc global lineGetAgentCapsA "lineGetAgentCapsA" int, int, int, int, sptr ; res = lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, varptr(lpAgentCaps)) ; hLineApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; dwAppAPIVersion : DWORD -> "int" ; lpAgentCaps : LINEAGENTCAPS* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT lineGetAgentCapsA(DWORD hLineApp, DWORD dwDeviceID, DWORD dwAddressID, DWORD dwAppAPIVersion, LINEAGENTCAPS* lpAgentCaps) #uselib "TAPI32.dll" #cfunc global lineGetAgentCapsA "lineGetAgentCapsA" int, int, int, int, var ; res = lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, lpAgentCaps) ; hLineApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; dwAppAPIVersion : DWORD -> "int" ; lpAgentCaps : LINEAGENTCAPS* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT lineGetAgentCapsA(DWORD hLineApp, DWORD dwDeviceID, DWORD dwAddressID, DWORD dwAppAPIVersion, LINEAGENTCAPS* lpAgentCaps) #uselib "TAPI32.dll" #cfunc global lineGetAgentCapsA "lineGetAgentCapsA" int, int, int, int, intptr ; res = lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, varptr(lpAgentCaps)) ; hLineApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAddressID : DWORD -> "int" ; dwAppAPIVersion : DWORD -> "int" ; lpAgentCaps : LINEAGENTCAPS* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proclineGetAgentCapsA = tapi32.NewProc("lineGetAgentCapsA")
)
// hLineApp (DWORD), dwDeviceID (DWORD), dwAddressID (DWORD), dwAppAPIVersion (DWORD), lpAgentCaps (LINEAGENTCAPS* in/out)
r1, _, err := proclineGetAgentCapsA.Call(
uintptr(hLineApp),
uintptr(dwDeviceID),
uintptr(dwAddressID),
uintptr(dwAppAPIVersion),
uintptr(lpAgentCaps),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction lineGetAgentCapsA(
hLineApp: DWORD; // DWORD
dwDeviceID: DWORD; // DWORD
dwAddressID: DWORD; // DWORD
dwAppAPIVersion: DWORD; // DWORD
lpAgentCaps: Pointer // LINEAGENTCAPS* in/out
): Integer; stdcall;
external 'TAPI32.dll' name 'lineGetAgentCapsA';result := DllCall("TAPI32\lineGetAgentCapsA"
, "UInt", hLineApp ; DWORD
, "UInt", dwDeviceID ; DWORD
, "UInt", dwAddressID ; DWORD
, "UInt", dwAppAPIVersion ; DWORD
, "Ptr", lpAgentCaps ; LINEAGENTCAPS* in/out
, "Int") ; return: INT●lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, lpAgentCaps) = DLL("TAPI32.dll", "int lineGetAgentCapsA(dword, dword, dword, dword, void*)")
# 呼び出し: lineGetAgentCapsA(hLineApp, dwDeviceID, dwAddressID, dwAppAPIVersion, lpAgentCaps)
# hLineApp : DWORD -> "dword"
# dwDeviceID : DWORD -> "dword"
# dwAddressID : DWORD -> "dword"
# dwAppAPIVersion : DWORD -> "dword"
# lpAgentCaps : LINEAGENTCAPS* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。