ホーム › Networking.WindowsWebServices › WsReadStartAttribute
WsReadStartAttribute
関数XML属性の読み取りを開始する。
シグネチャ
// webservices.dll
#include <windows.h>
HRESULT WsReadStartAttribute(
WS_XML_READER* reader,
DWORD attributeIndex,
WS_ERROR* error // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| reader | WS_XML_READER* | in |
| attributeIndex | DWORD | in |
| error | WS_ERROR* | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// webservices.dll
#include <windows.h>
HRESULT WsReadStartAttribute(
WS_XML_READER* reader,
DWORD attributeIndex,
WS_ERROR* error // optional
);[DllImport("webservices.dll", ExactSpelling = true)]
static extern int WsReadStartAttribute(
ref IntPtr reader, // WS_XML_READER*
uint attributeIndex, // DWORD
IntPtr error // WS_ERROR* optional
);<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Function WsReadStartAttribute(
ByRef reader As IntPtr, ' WS_XML_READER*
attributeIndex As UInteger, ' DWORD
[error] As IntPtr ' WS_ERROR* optional
) As Integer
End Function' reader : WS_XML_READER*
' attributeIndex : DWORD
' error : WS_ERROR* optional
Declare PtrSafe Function WsReadStartAttribute Lib "webservices" ( _
ByRef reader As LongPtr, _
ByVal attributeIndex As Long, _
ByVal error As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WsReadStartAttribute = ctypes.windll.webservices.WsReadStartAttribute
WsReadStartAttribute.restype = ctypes.c_int
WsReadStartAttribute.argtypes = [
ctypes.c_void_p, # reader : WS_XML_READER*
wintypes.DWORD, # attributeIndex : DWORD
ctypes.c_void_p, # error : WS_ERROR* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('webservices.dll')
WsReadStartAttribute = Fiddle::Function.new(
lib['WsReadStartAttribute'],
[
Fiddle::TYPE_VOIDP, # reader : WS_XML_READER*
-Fiddle::TYPE_INT, # attributeIndex : DWORD
Fiddle::TYPE_VOIDP, # error : WS_ERROR* optional
],
Fiddle::TYPE_INT)#[link(name = "webservices")]
extern "system" {
fn WsReadStartAttribute(
reader: *mut isize, // WS_XML_READER*
attributeIndex: u32, // DWORD
error: *mut isize // WS_ERROR* optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("webservices.dll")]
public static extern int WsReadStartAttribute(ref IntPtr reader, uint attributeIndex, IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsReadStartAttribute' -Namespace Win32 -PassThru
# $api::WsReadStartAttribute(reader, attributeIndex, error)#uselib "webservices.dll"
#func global WsReadStartAttribute "WsReadStartAttribute" sptr, sptr, sptr
; WsReadStartAttribute reader, attributeIndex, error ; 戻り値は stat
; reader : WS_XML_READER* -> "sptr"
; attributeIndex : DWORD -> "sptr"
; error : WS_ERROR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "webservices.dll"
#cfunc global WsReadStartAttribute "WsReadStartAttribute" int, int, int
; res = WsReadStartAttribute(reader, attributeIndex, error)
; reader : WS_XML_READER* -> "int"
; attributeIndex : DWORD -> "int"
; error : WS_ERROR* optional -> "int"; HRESULT WsReadStartAttribute(WS_XML_READER* reader, DWORD attributeIndex, WS_ERROR* error)
#uselib "webservices.dll"
#cfunc global WsReadStartAttribute "WsReadStartAttribute" int, int, int
; res = WsReadStartAttribute(reader, attributeIndex, error)
; reader : WS_XML_READER* -> "int"
; attributeIndex : DWORD -> "int"
; error : WS_ERROR* optional -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
webservices = windows.NewLazySystemDLL("webservices.dll")
procWsReadStartAttribute = webservices.NewProc("WsReadStartAttribute")
)
// reader (WS_XML_READER*), attributeIndex (DWORD), error (WS_ERROR* optional)
r1, _, err := procWsReadStartAttribute.Call(
uintptr(reader),
uintptr(attributeIndex),
uintptr(error),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WsReadStartAttribute(
reader: Pointer; // WS_XML_READER*
attributeIndex: DWORD; // DWORD
error: Pointer // WS_ERROR* optional
): Integer; stdcall;
external 'webservices.dll' name 'WsReadStartAttribute';result := DllCall("webservices\WsReadStartAttribute"
, "Ptr", reader ; WS_XML_READER*
, "UInt", attributeIndex ; DWORD
, "Ptr", error ; WS_ERROR* optional
, "Int") ; return: HRESULT●WsReadStartAttribute(reader, attributeIndex, error) = DLL("webservices.dll", "int WsReadStartAttribute(void*, dword, void*)")
# 呼び出し: WsReadStartAttribute(reader, attributeIndex, error)
# reader : WS_XML_READER* -> "void*"
# attributeIndex : DWORD -> "dword"
# error : WS_ERROR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。