ホーム › UI.WindowsAndMessaging › MrmDumpPriFile
MrmDumpPriFile
関数PRIファイルの内容をXMLにダンプ出力する。
シグネチャ
// MrmSupport.dll
#include <windows.h>
HRESULT MrmDumpPriFile(
LPCWSTR indexFileName,
LPCWSTR schemaPriFile, // optional
MrmDumpType dumpType,
LPCWSTR outputXmlFile
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| indexFileName | LPCWSTR | in |
| schemaPriFile | LPCWSTR | inoptional |
| dumpType | MrmDumpType | in |
| outputXmlFile | LPCWSTR | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// MrmSupport.dll
#include <windows.h>
HRESULT MrmDumpPriFile(
LPCWSTR indexFileName,
LPCWSTR schemaPriFile, // optional
MrmDumpType dumpType,
LPCWSTR outputXmlFile
);[DllImport("MrmSupport.dll", ExactSpelling = true)]
static extern int MrmDumpPriFile(
[MarshalAs(UnmanagedType.LPWStr)] string indexFileName, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string schemaPriFile, // LPCWSTR optional
int dumpType, // MrmDumpType
[MarshalAs(UnmanagedType.LPWStr)] string outputXmlFile // LPCWSTR
);<DllImport("MrmSupport.dll", ExactSpelling:=True)>
Public Shared Function MrmDumpPriFile(
<MarshalAs(UnmanagedType.LPWStr)> indexFileName As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> schemaPriFile As String, ' LPCWSTR optional
dumpType As Integer, ' MrmDumpType
<MarshalAs(UnmanagedType.LPWStr)> outputXmlFile As String ' LPCWSTR
) As Integer
End Function' indexFileName : LPCWSTR
' schemaPriFile : LPCWSTR optional
' dumpType : MrmDumpType
' outputXmlFile : LPCWSTR
Declare PtrSafe Function MrmDumpPriFile Lib "mrmsupport" ( _
ByVal indexFileName As LongPtr, _
ByVal schemaPriFile As LongPtr, _
ByVal dumpType As Long, _
ByVal outputXmlFile As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MrmDumpPriFile = ctypes.windll.mrmsupport.MrmDumpPriFile
MrmDumpPriFile.restype = ctypes.c_int
MrmDumpPriFile.argtypes = [
wintypes.LPCWSTR, # indexFileName : LPCWSTR
wintypes.LPCWSTR, # schemaPriFile : LPCWSTR optional
ctypes.c_int, # dumpType : MrmDumpType
wintypes.LPCWSTR, # outputXmlFile : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MrmSupport.dll')
MrmDumpPriFile = Fiddle::Function.new(
lib['MrmDumpPriFile'],
[
Fiddle::TYPE_VOIDP, # indexFileName : LPCWSTR
Fiddle::TYPE_VOIDP, # schemaPriFile : LPCWSTR optional
Fiddle::TYPE_INT, # dumpType : MrmDumpType
Fiddle::TYPE_VOIDP, # outputXmlFile : LPCWSTR
],
Fiddle::TYPE_INT)#[link(name = "mrmsupport")]
extern "system" {
fn MrmDumpPriFile(
indexFileName: *const u16, // LPCWSTR
schemaPriFile: *const u16, // LPCWSTR optional
dumpType: i32, // MrmDumpType
outputXmlFile: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MrmSupport.dll")]
public static extern int MrmDumpPriFile([MarshalAs(UnmanagedType.LPWStr)] string indexFileName, [MarshalAs(UnmanagedType.LPWStr)] string schemaPriFile, int dumpType, [MarshalAs(UnmanagedType.LPWStr)] string outputXmlFile);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MrmSupport_MrmDumpPriFile' -Namespace Win32 -PassThru
# $api::MrmDumpPriFile(indexFileName, schemaPriFile, dumpType, outputXmlFile)#uselib "MrmSupport.dll"
#func global MrmDumpPriFile "MrmDumpPriFile" sptr, sptr, sptr, sptr
; MrmDumpPriFile indexFileName, schemaPriFile, dumpType, outputXmlFile ; 戻り値は stat
; indexFileName : LPCWSTR -> "sptr"
; schemaPriFile : LPCWSTR optional -> "sptr"
; dumpType : MrmDumpType -> "sptr"
; outputXmlFile : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MrmSupport.dll"
#cfunc global MrmDumpPriFile "MrmDumpPriFile" wstr, wstr, int, wstr
; res = MrmDumpPriFile(indexFileName, schemaPriFile, dumpType, outputXmlFile)
; indexFileName : LPCWSTR -> "wstr"
; schemaPriFile : LPCWSTR optional -> "wstr"
; dumpType : MrmDumpType -> "int"
; outputXmlFile : LPCWSTR -> "wstr"; HRESULT MrmDumpPriFile(LPCWSTR indexFileName, LPCWSTR schemaPriFile, MrmDumpType dumpType, LPCWSTR outputXmlFile)
#uselib "MrmSupport.dll"
#cfunc global MrmDumpPriFile "MrmDumpPriFile" wstr, wstr, int, wstr
; res = MrmDumpPriFile(indexFileName, schemaPriFile, dumpType, outputXmlFile)
; indexFileName : LPCWSTR -> "wstr"
; schemaPriFile : LPCWSTR optional -> "wstr"
; dumpType : MrmDumpType -> "int"
; outputXmlFile : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mrmsupport = windows.NewLazySystemDLL("MrmSupport.dll")
procMrmDumpPriFile = mrmsupport.NewProc("MrmDumpPriFile")
)
// indexFileName (LPCWSTR), schemaPriFile (LPCWSTR optional), dumpType (MrmDumpType), outputXmlFile (LPCWSTR)
r1, _, err := procMrmDumpPriFile.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(indexFileName))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(schemaPriFile))),
uintptr(dumpType),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(outputXmlFile))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MrmDumpPriFile(
indexFileName: PWideChar; // LPCWSTR
schemaPriFile: PWideChar; // LPCWSTR optional
dumpType: Integer; // MrmDumpType
outputXmlFile: PWideChar // LPCWSTR
): Integer; stdcall;
external 'MrmSupport.dll' name 'MrmDumpPriFile';result := DllCall("MrmSupport\MrmDumpPriFile"
, "WStr", indexFileName ; LPCWSTR
, "WStr", schemaPriFile ; LPCWSTR optional
, "Int", dumpType ; MrmDumpType
, "WStr", outputXmlFile ; LPCWSTR
, "Int") ; return: HRESULT●MrmDumpPriFile(indexFileName, schemaPriFile, dumpType, outputXmlFile) = DLL("MrmSupport.dll", "int MrmDumpPriFile(char*, char*, int, char*)")
# 呼び出し: MrmDumpPriFile(indexFileName, schemaPriFile, dumpType, outputXmlFile)
# indexFileName : LPCWSTR -> "char*"
# schemaPriFile : LPCWSTR optional -> "char*"
# dumpType : MrmDumpType -> "int"
# outputXmlFile : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。