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