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