ホーム › Devices.Tapi › lineSetTollList
lineSetTollList
関数指定した地域の市外通話扱いとなる料金リストを設定する。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineSetTollList(
DWORD hLineApp,
DWORD dwDeviceID,
LPCSTR lpszAddressIn,
DWORD dwTollListOption
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hLineApp | DWORD | in |
| dwDeviceID | DWORD | in |
| lpszAddressIn | LPCSTR | in |
| dwTollListOption | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineSetTollList(
DWORD hLineApp,
DWORD dwDeviceID,
LPCSTR lpszAddressIn,
DWORD dwTollListOption
);[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineSetTollList(
uint hLineApp, // DWORD
uint dwDeviceID, // DWORD
[MarshalAs(UnmanagedType.LPStr)] string lpszAddressIn, // LPCSTR
uint dwTollListOption // DWORD
);<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function lineSetTollList(
hLineApp As UInteger, ' DWORD
dwDeviceID As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPStr)> lpszAddressIn As String, ' LPCSTR
dwTollListOption As UInteger ' DWORD
) As Integer
End Function' hLineApp : DWORD
' dwDeviceID : DWORD
' lpszAddressIn : LPCSTR
' dwTollListOption : DWORD
Declare PtrSafe Function lineSetTollList Lib "tapi32" ( _
ByVal hLineApp As Long, _
ByVal dwDeviceID As Long, _
ByVal lpszAddressIn As String, _
ByVal dwTollListOption As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
lineSetTollList = ctypes.windll.tapi32.lineSetTollList
lineSetTollList.restype = ctypes.c_int
lineSetTollList.argtypes = [
wintypes.DWORD, # hLineApp : DWORD
wintypes.DWORD, # dwDeviceID : DWORD
wintypes.LPCSTR, # lpszAddressIn : LPCSTR
wintypes.DWORD, # dwTollListOption : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
lineSetTollList = Fiddle::Function.new(
lib['lineSetTollList'],
[
-Fiddle::TYPE_INT, # hLineApp : DWORD
-Fiddle::TYPE_INT, # dwDeviceID : DWORD
Fiddle::TYPE_VOIDP, # lpszAddressIn : LPCSTR
-Fiddle::TYPE_INT, # dwTollListOption : DWORD
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn lineSetTollList(
hLineApp: u32, // DWORD
dwDeviceID: u32, // DWORD
lpszAddressIn: *const u8, // LPCSTR
dwTollListOption: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int lineSetTollList(uint hLineApp, uint dwDeviceID, [MarshalAs(UnmanagedType.LPStr)] string lpszAddressIn, uint dwTollListOption);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineSetTollList' -Namespace Win32 -PassThru
# $api::lineSetTollList(hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption)#uselib "TAPI32.dll"
#func global lineSetTollList "lineSetTollList" sptr, sptr, sptr, sptr
; lineSetTollList hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption ; 戻り値は stat
; hLineApp : DWORD -> "sptr"
; dwDeviceID : DWORD -> "sptr"
; lpszAddressIn : LPCSTR -> "sptr"
; dwTollListOption : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global lineSetTollList "lineSetTollList" int, int, str, int
; res = lineSetTollList(hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption)
; hLineApp : DWORD -> "int"
; dwDeviceID : DWORD -> "int"
; lpszAddressIn : LPCSTR -> "str"
; dwTollListOption : DWORD -> "int"; INT lineSetTollList(DWORD hLineApp, DWORD dwDeviceID, LPCSTR lpszAddressIn, DWORD dwTollListOption)
#uselib "TAPI32.dll"
#cfunc global lineSetTollList "lineSetTollList" int, int, str, int
; res = lineSetTollList(hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption)
; hLineApp : DWORD -> "int"
; dwDeviceID : DWORD -> "int"
; lpszAddressIn : LPCSTR -> "str"
; dwTollListOption : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proclineSetTollList = tapi32.NewProc("lineSetTollList")
)
// hLineApp (DWORD), dwDeviceID (DWORD), lpszAddressIn (LPCSTR), dwTollListOption (DWORD)
r1, _, err := proclineSetTollList.Call(
uintptr(hLineApp),
uintptr(dwDeviceID),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszAddressIn))),
uintptr(dwTollListOption),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction lineSetTollList(
hLineApp: DWORD; // DWORD
dwDeviceID: DWORD; // DWORD
lpszAddressIn: PAnsiChar; // LPCSTR
dwTollListOption: DWORD // DWORD
): Integer; stdcall;
external 'TAPI32.dll' name 'lineSetTollList';result := DllCall("TAPI32\lineSetTollList"
, "UInt", hLineApp ; DWORD
, "UInt", dwDeviceID ; DWORD
, "AStr", lpszAddressIn ; LPCSTR
, "UInt", dwTollListOption ; DWORD
, "Int") ; return: INT●lineSetTollList(hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption) = DLL("TAPI32.dll", "int lineSetTollList(dword, dword, char*, dword)")
# 呼び出し: lineSetTollList(hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption)
# hLineApp : DWORD -> "dword"
# dwDeviceID : DWORD -> "dword"
# lpszAddressIn : LPCSTR -> "char*"
# dwTollListOption : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。