ホーム › Devices.WebServicesOnDevices › WSDCreateOutboundAttachment
WSDCreateOutboundAttachment
関数WSDメッセージの送信用添付オブジェクトを作成する。
シグネチャ
// wsdapi.dll
#include <windows.h>
HRESULT WSDCreateOutboundAttachment(
IWSDOutboundAttachment** ppAttachment
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ppAttachment | IWSDOutboundAttachment** | out | 作成したIWSDOutboundAttachmentオブジェクトを受け取る出力先ポインタ。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// wsdapi.dll
#include <windows.h>
HRESULT WSDCreateOutboundAttachment(
IWSDOutboundAttachment** ppAttachment
);[DllImport("wsdapi.dll", ExactSpelling = true)]
static extern int WSDCreateOutboundAttachment(
IntPtr ppAttachment // IWSDOutboundAttachment** out
);<DllImport("wsdapi.dll", ExactSpelling:=True)>
Public Shared Function WSDCreateOutboundAttachment(
ppAttachment As IntPtr ' IWSDOutboundAttachment** out
) As Integer
End Function' ppAttachment : IWSDOutboundAttachment** out
Declare PtrSafe Function WSDCreateOutboundAttachment Lib "wsdapi" ( _
ByVal ppAttachment As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WSDCreateOutboundAttachment = ctypes.windll.wsdapi.WSDCreateOutboundAttachment
WSDCreateOutboundAttachment.restype = ctypes.c_int
WSDCreateOutboundAttachment.argtypes = [
ctypes.c_void_p, # ppAttachment : IWSDOutboundAttachment** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('wsdapi.dll')
WSDCreateOutboundAttachment = Fiddle::Function.new(
lib['WSDCreateOutboundAttachment'],
[
Fiddle::TYPE_VOIDP, # ppAttachment : IWSDOutboundAttachment** out
],
Fiddle::TYPE_INT)#[link(name = "wsdapi")]
extern "system" {
fn WSDCreateOutboundAttachment(
ppAttachment: *mut *mut core::ffi::c_void // IWSDOutboundAttachment** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("wsdapi.dll")]
public static extern int WSDCreateOutboundAttachment(IntPtr ppAttachment);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wsdapi_WSDCreateOutboundAttachment' -Namespace Win32 -PassThru
# $api::WSDCreateOutboundAttachment(ppAttachment)#uselib "wsdapi.dll"
#func global WSDCreateOutboundAttachment "WSDCreateOutboundAttachment" sptr
; WSDCreateOutboundAttachment ppAttachment ; 戻り値は stat
; ppAttachment : IWSDOutboundAttachment** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "wsdapi.dll"
#cfunc global WSDCreateOutboundAttachment "WSDCreateOutboundAttachment" sptr
; res = WSDCreateOutboundAttachment(ppAttachment)
; ppAttachment : IWSDOutboundAttachment** out -> "sptr"; HRESULT WSDCreateOutboundAttachment(IWSDOutboundAttachment** ppAttachment)
#uselib "wsdapi.dll"
#cfunc global WSDCreateOutboundAttachment "WSDCreateOutboundAttachment" intptr
; res = WSDCreateOutboundAttachment(ppAttachment)
; ppAttachment : IWSDOutboundAttachment** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wsdapi = windows.NewLazySystemDLL("wsdapi.dll")
procWSDCreateOutboundAttachment = wsdapi.NewProc("WSDCreateOutboundAttachment")
)
// ppAttachment (IWSDOutboundAttachment** out)
r1, _, err := procWSDCreateOutboundAttachment.Call(
uintptr(ppAttachment),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WSDCreateOutboundAttachment(
ppAttachment: Pointer // IWSDOutboundAttachment** out
): Integer; stdcall;
external 'wsdapi.dll' name 'WSDCreateOutboundAttachment';result := DllCall("wsdapi\WSDCreateOutboundAttachment"
, "Ptr", ppAttachment ; IWSDOutboundAttachment** out
, "Int") ; return: HRESULT●WSDCreateOutboundAttachment(ppAttachment) = DLL("wsdapi.dll", "int WSDCreateOutboundAttachment(void*)")
# 呼び出し: WSDCreateOutboundAttachment(ppAttachment)
# ppAttachment : IWSDOutboundAttachment** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。