ホーム › Data.Xml.XmlLite › CreateXmlReader
CreateXmlReader
関数XmlLiteのXMLリーダーを作成する。
シグネチャ
// XmlLite.dll
#include <windows.h>
HRESULT CreateXmlReader(
const GUID* riid,
void** ppvObject,
IMalloc* pMalloc // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| riid | GUID* | in |
| ppvObject | void** | out |
| pMalloc | IMalloc* | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// XmlLite.dll
#include <windows.h>
HRESULT CreateXmlReader(
const GUID* riid,
void** ppvObject,
IMalloc* pMalloc // optional
);[DllImport("XmlLite.dll", ExactSpelling = true)]
static extern int CreateXmlReader(
ref Guid riid, // GUID*
IntPtr ppvObject, // void** out
IntPtr pMalloc // IMalloc* optional
);<DllImport("XmlLite.dll", ExactSpelling:=True)>
Public Shared Function CreateXmlReader(
ByRef riid As Guid, ' GUID*
ppvObject As IntPtr, ' void** out
pMalloc As IntPtr ' IMalloc* optional
) As Integer
End Function' riid : GUID*
' ppvObject : void** out
' pMalloc : IMalloc* optional
Declare PtrSafe Function CreateXmlReader Lib "xmllite" ( _
ByVal riid As LongPtr, _
ByVal ppvObject As LongPtr, _
ByVal pMalloc As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CreateXmlReader = ctypes.windll.xmllite.CreateXmlReader
CreateXmlReader.restype = ctypes.c_int
CreateXmlReader.argtypes = [
ctypes.c_void_p, # riid : GUID*
ctypes.c_void_p, # ppvObject : void** out
ctypes.c_void_p, # pMalloc : IMalloc* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('XmlLite.dll')
CreateXmlReader = Fiddle::Function.new(
lib['CreateXmlReader'],
[
Fiddle::TYPE_VOIDP, # riid : GUID*
Fiddle::TYPE_VOIDP, # ppvObject : void** out
Fiddle::TYPE_VOIDP, # pMalloc : IMalloc* optional
],
Fiddle::TYPE_INT)#[link(name = "xmllite")]
extern "system" {
fn CreateXmlReader(
riid: *const GUID, // GUID*
ppvObject: *mut *mut (), // void** out
pMalloc: *mut core::ffi::c_void // IMalloc* optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("XmlLite.dll")]
public static extern int CreateXmlReader(ref Guid riid, IntPtr ppvObject, IntPtr pMalloc);
"@
$api = Add-Type -MemberDefinition $sig -Name 'XmlLite_CreateXmlReader' -Namespace Win32 -PassThru
# $api::CreateXmlReader(riid, ppvObject, pMalloc)#uselib "XmlLite.dll"
#func global CreateXmlReader "CreateXmlReader" sptr, sptr, sptr
; CreateXmlReader varptr(riid), ppvObject, pMalloc ; 戻り値は stat
; riid : GUID* -> "sptr"
; ppvObject : void** out -> "sptr"
; pMalloc : IMalloc* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "XmlLite.dll" #cfunc global CreateXmlReader "CreateXmlReader" var, sptr, sptr ; res = CreateXmlReader(riid, ppvObject, pMalloc) ; riid : GUID* -> "var" ; ppvObject : void** out -> "sptr" ; pMalloc : IMalloc* optional -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "XmlLite.dll" #cfunc global CreateXmlReader "CreateXmlReader" sptr, sptr, sptr ; res = CreateXmlReader(varptr(riid), ppvObject, pMalloc) ; riid : GUID* -> "sptr" ; ppvObject : void** out -> "sptr" ; pMalloc : IMalloc* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT CreateXmlReader(GUID* riid, void** ppvObject, IMalloc* pMalloc) #uselib "XmlLite.dll" #cfunc global CreateXmlReader "CreateXmlReader" var, intptr, intptr ; res = CreateXmlReader(riid, ppvObject, pMalloc) ; riid : GUID* -> "var" ; ppvObject : void** out -> "intptr" ; pMalloc : IMalloc* optional -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT CreateXmlReader(GUID* riid, void** ppvObject, IMalloc* pMalloc) #uselib "XmlLite.dll" #cfunc global CreateXmlReader "CreateXmlReader" intptr, intptr, intptr ; res = CreateXmlReader(varptr(riid), ppvObject, pMalloc) ; riid : GUID* -> "intptr" ; ppvObject : void** out -> "intptr" ; pMalloc : IMalloc* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
xmllite = windows.NewLazySystemDLL("XmlLite.dll")
procCreateXmlReader = xmllite.NewProc("CreateXmlReader")
)
// riid (GUID*), ppvObject (void** out), pMalloc (IMalloc* optional)
r1, _, err := procCreateXmlReader.Call(
uintptr(riid),
uintptr(ppvObject),
uintptr(pMalloc),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CreateXmlReader(
riid: PGUID; // GUID*
ppvObject: Pointer; // void** out
pMalloc: Pointer // IMalloc* optional
): Integer; stdcall;
external 'XmlLite.dll' name 'CreateXmlReader';result := DllCall("XmlLite\CreateXmlReader"
, "Ptr", riid ; GUID*
, "Ptr", ppvObject ; void** out
, "Ptr", pMalloc ; IMalloc* optional
, "Int") ; return: HRESULT●CreateXmlReader(riid, ppvObject, pMalloc) = DLL("XmlLite.dll", "int CreateXmlReader(void*, void*, void*)")
# 呼び出し: CreateXmlReader(riid, ppvObject, pMalloc)
# riid : GUID* -> "void*"
# ppvObject : void** out -> "void*"
# pMalloc : IMalloc* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。