Win32 API 日本語リファレンス
ホームDevices.Tapi › lineMakeCallA

lineMakeCallA

関数
指定アドレスへ発信して新しい通話を開始する(ANSI版)。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

// TAPI32.dll  (ANSI / -A)
#include <windows.h>

INT lineMakeCallA(
    DWORD hLine,
    DWORD* lphCall,
    LPCSTR lpszDestAddress,
    DWORD dwCountryCode,
    const LINECALLPARAMS* lpCallParams
);

パラメーター

名前方向
hLineDWORDin
lphCallDWORD*inout
lpszDestAddressLPCSTRin
dwCountryCodeDWORDin
lpCallParamsLINECALLPARAMS*in

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll  (ANSI / -A)
#include <windows.h>

INT lineMakeCallA(
    DWORD hLine,
    DWORD* lphCall,
    LPCSTR lpszDestAddress,
    DWORD dwCountryCode,
    const LINECALLPARAMS* lpCallParams
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineMakeCallA(
    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 lineMakeCallA(
    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 lineMakeCallA 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

lineMakeCallA = ctypes.windll.tapi32.lineMakeCallA
lineMakeCallA.restype = ctypes.c_int
lineMakeCallA.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')
lineMakeCallA = Fiddle::Function.new(
  lib['lineMakeCallA'],
  [
    -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 lineMakeCallA(
        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 lineMakeCallA(uint hLine, ref uint lphCall, [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress, uint dwCountryCode, IntPtr lpCallParams);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineMakeCallA' -Namespace Win32 -PassThru
# $api::lineMakeCallA(hLine, lphCall, lpszDestAddress, dwCountryCode, lpCallParams)
#uselib "TAPI32.dll"
#func global lineMakeCallA "lineMakeCallA" sptr, sptr, sptr, sptr, sptr
; lineMakeCallA 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 lineMakeCallA "lineMakeCallA" int, var, str, int, var
; res = lineMakeCallA(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 lineMakeCallA(DWORD hLine, DWORD* lphCall, LPCSTR lpszDestAddress, DWORD dwCountryCode, LINECALLPARAMS* lpCallParams)
#uselib "TAPI32.dll"
#cfunc global lineMakeCallA "lineMakeCallA" int, var, str, int, var
; res = lineMakeCallA(hLine, lphCall, lpszDestAddress, dwCountryCode, lpCallParams)
; hLine : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCSTR -> "str"
; dwCountryCode : DWORD -> "int"
; lpCallParams : LINECALLPARAMS* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineMakeCallA = tapi32.NewProc("lineMakeCallA")
)

// hLine (DWORD), lphCall (DWORD* in/out), lpszDestAddress (LPCSTR), dwCountryCode (DWORD), lpCallParams (LINECALLPARAMS*)
r1, _, err := proclineMakeCallA.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   // INT
function lineMakeCallA(
  hLine: DWORD;   // DWORD
  lphCall: Pointer;   // DWORD* in/out
  lpszDestAddress: PAnsiChar;   // LPCSTR
  dwCountryCode: DWORD;   // DWORD
  lpCallParams: Pointer   // LINECALLPARAMS*
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineMakeCallA';
result := DllCall("TAPI32\lineMakeCallA"
    , "UInt", hLine   ; DWORD
    , "Ptr", lphCall   ; DWORD* in/out
    , "AStr", lpszDestAddress   ; LPCSTR
    , "UInt", dwCountryCode   ; DWORD
    , "Ptr", lpCallParams   ; LINECALLPARAMS*
    , "Int")   ; return: INT
●lineMakeCallA(hLine, lphCall, lpszDestAddress, dwCountryCode, lpCallParams) = DLL("TAPI32.dll", "int lineMakeCallA(dword, void*, char*, dword, void*)")
# 呼び出し: lineMakeCallA(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)。