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