ホーム › Devices.Tapi › lineDialW
lineDialW
関数接続済みの通話で指定アドレスへダイヤルする(Unicode版)。
シグネチャ
// TAPI32.dll (Unicode / -W)
#include <windows.h>
INT lineDialW(
DWORD hCall,
LPCWSTR lpszDestAddress,
DWORD dwCountryCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hCall | DWORD | in |
| lpszDestAddress | LPCWSTR | in |
| dwCountryCode | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (Unicode / -W)
#include <windows.h>
INT lineDialW(
DWORD hCall,
LPCWSTR lpszDestAddress,
DWORD dwCountryCode
);[DllImport("TAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int lineDialW(
uint hCall, // DWORD
[MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress, // LPCWSTR
uint dwCountryCode // DWORD
);<DllImport("TAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function lineDialW(
hCall As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPWStr)> lpszDestAddress As String, ' LPCWSTR
dwCountryCode As UInteger ' DWORD
) As Integer
End Function' hCall : DWORD
' lpszDestAddress : LPCWSTR
' dwCountryCode : DWORD
Declare PtrSafe Function lineDialW Lib "tapi32" ( _
ByVal hCall As Long, _
ByVal lpszDestAddress As LongPtr, _
ByVal dwCountryCode As Long) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
lineDialW = ctypes.windll.tapi32.lineDialW
lineDialW.restype = ctypes.c_int
lineDialW.argtypes = [
wintypes.DWORD, # hCall : DWORD
wintypes.LPCWSTR, # lpszDestAddress : LPCWSTR
wintypes.DWORD, # dwCountryCode : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
lineDialW = Fiddle::Function.new(
lib['lineDialW'],
[
-Fiddle::TYPE_INT, # hCall : DWORD
Fiddle::TYPE_VOIDP, # lpszDestAddress : LPCWSTR
-Fiddle::TYPE_INT, # dwCountryCode : DWORD
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "tapi32")]
extern "system" {
fn lineDialW(
hCall: u32, // DWORD
lpszDestAddress: *const u16, // LPCWSTR
dwCountryCode: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode)]
public static extern int lineDialW(uint hCall, [MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress, uint dwCountryCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineDialW' -Namespace Win32 -PassThru
# $api::lineDialW(hCall, lpszDestAddress, dwCountryCode)#uselib "TAPI32.dll"
#func global lineDialW "lineDialW" wptr, wptr, wptr
; lineDialW hCall, lpszDestAddress, dwCountryCode ; 戻り値は stat
; hCall : DWORD -> "wptr"
; lpszDestAddress : LPCWSTR -> "wptr"
; dwCountryCode : DWORD -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global lineDialW "lineDialW" int, wstr, int
; res = lineDialW(hCall, lpszDestAddress, dwCountryCode)
; hCall : DWORD -> "int"
; lpszDestAddress : LPCWSTR -> "wstr"
; dwCountryCode : DWORD -> "int"; INT lineDialW(DWORD hCall, LPCWSTR lpszDestAddress, DWORD dwCountryCode)
#uselib "TAPI32.dll"
#cfunc global lineDialW "lineDialW" int, wstr, int
; res = lineDialW(hCall, lpszDestAddress, dwCountryCode)
; hCall : DWORD -> "int"
; lpszDestAddress : LPCWSTR -> "wstr"
; dwCountryCode : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proclineDialW = tapi32.NewProc("lineDialW")
)
// hCall (DWORD), lpszDestAddress (LPCWSTR), dwCountryCode (DWORD)
r1, _, err := proclineDialW.Call(
uintptr(hCall),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszDestAddress))),
uintptr(dwCountryCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction lineDialW(
hCall: DWORD; // DWORD
lpszDestAddress: PWideChar; // LPCWSTR
dwCountryCode: DWORD // DWORD
): Integer; stdcall;
external 'TAPI32.dll' name 'lineDialW';result := DllCall("TAPI32\lineDialW"
, "UInt", hCall ; DWORD
, "WStr", lpszDestAddress ; LPCWSTR
, "UInt", dwCountryCode ; DWORD
, "Int") ; return: INT●lineDialW(hCall, lpszDestAddress, dwCountryCode) = DLL("TAPI32.dll", "int lineDialW(dword, char*, dword)")
# 呼び出し: lineDialW(hCall, lpszDestAddress, dwCountryCode)
# hCall : DWORD -> "dword"
# lpszDestAddress : LPCWSTR -> "char*"
# dwCountryCode : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。