Win32 API 日本語リファレンス
ホームUI.WindowsAndMessaging › MrmCreateResourceIndexerFromPreviousPriFile

MrmCreateResourceIndexerFromPreviousPriFile

関数
既存PRIファイルからリソースインデクサを作成する。
DLLMrmSupport.dll呼出規約winapi

シグネチャ

// MrmSupport.dll
#include <windows.h>

HRESULT MrmCreateResourceIndexerFromPreviousPriFile(
    LPCWSTR projectRoot,
    MrmPlatformVersion platformVersion,
    LPCWSTR defaultQualifiers,   // optional
    LPCWSTR priFile,
    MrmResourceIndexerHandle* indexer
);

パラメーター

名前方向
projectRootLPCWSTRin
platformVersionMrmPlatformVersionin
defaultQualifiersLPCWSTRinoptional
priFileLPCWSTRin
indexerMrmResourceIndexerHandle*inout

戻り値の型: HRESULT

各言語での呼び出し定義

// MrmSupport.dll
#include <windows.h>

HRESULT MrmCreateResourceIndexerFromPreviousPriFile(
    LPCWSTR projectRoot,
    MrmPlatformVersion platformVersion,
    LPCWSTR defaultQualifiers,   // optional
    LPCWSTR priFile,
    MrmResourceIndexerHandle* indexer
);
[DllImport("MrmSupport.dll", ExactSpelling = true)]
static extern int MrmCreateResourceIndexerFromPreviousPriFile(
    [MarshalAs(UnmanagedType.LPWStr)] string projectRoot,   // LPCWSTR
    int platformVersion,   // MrmPlatformVersion
    [MarshalAs(UnmanagedType.LPWStr)] string defaultQualifiers,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string priFile,   // LPCWSTR
    IntPtr indexer   // MrmResourceIndexerHandle* in/out
);
<DllImport("MrmSupport.dll", ExactSpelling:=True)>
Public Shared Function MrmCreateResourceIndexerFromPreviousPriFile(
    <MarshalAs(UnmanagedType.LPWStr)> projectRoot As String,   ' LPCWSTR
    platformVersion As Integer,   ' MrmPlatformVersion
    <MarshalAs(UnmanagedType.LPWStr)> defaultQualifiers As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> priFile As String,   ' LPCWSTR
    indexer As IntPtr   ' MrmResourceIndexerHandle* in/out
) As Integer
End Function
' projectRoot : LPCWSTR
' platformVersion : MrmPlatformVersion
' defaultQualifiers : LPCWSTR optional
' priFile : LPCWSTR
' indexer : MrmResourceIndexerHandle* in/out
Declare PtrSafe Function MrmCreateResourceIndexerFromPreviousPriFile Lib "mrmsupport" ( _
    ByVal projectRoot As LongPtr, _
    ByVal platformVersion As Long, _
    ByVal defaultQualifiers As LongPtr, _
    ByVal priFile 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

MrmCreateResourceIndexerFromPreviousPriFile = ctypes.windll.mrmsupport.MrmCreateResourceIndexerFromPreviousPriFile
MrmCreateResourceIndexerFromPreviousPriFile.restype = ctypes.c_int
MrmCreateResourceIndexerFromPreviousPriFile.argtypes = [
    wintypes.LPCWSTR,  # projectRoot : LPCWSTR
    ctypes.c_int,  # platformVersion : MrmPlatformVersion
    wintypes.LPCWSTR,  # defaultQualifiers : LPCWSTR optional
    wintypes.LPCWSTR,  # priFile : LPCWSTR
    ctypes.c_void_p,  # indexer : MrmResourceIndexerHandle* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MrmSupport.dll')
MrmCreateResourceIndexerFromPreviousPriFile = Fiddle::Function.new(
  lib['MrmCreateResourceIndexerFromPreviousPriFile'],
  [
    Fiddle::TYPE_VOIDP,  # projectRoot : LPCWSTR
    Fiddle::TYPE_INT,  # platformVersion : MrmPlatformVersion
    Fiddle::TYPE_VOIDP,  # defaultQualifiers : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # priFile : LPCWSTR
    Fiddle::TYPE_VOIDP,  # indexer : MrmResourceIndexerHandle* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mrmsupport")]
extern "system" {
    fn MrmCreateResourceIndexerFromPreviousPriFile(
        projectRoot: *const u16,  // LPCWSTR
        platformVersion: i32,  // MrmPlatformVersion
        defaultQualifiers: *const u16,  // LPCWSTR optional
        priFile: *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 MrmCreateResourceIndexerFromPreviousPriFile([MarshalAs(UnmanagedType.LPWStr)] string projectRoot, int platformVersion, [MarshalAs(UnmanagedType.LPWStr)] string defaultQualifiers, [MarshalAs(UnmanagedType.LPWStr)] string priFile, IntPtr indexer);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MrmSupport_MrmCreateResourceIndexerFromPreviousPriFile' -Namespace Win32 -PassThru
# $api::MrmCreateResourceIndexerFromPreviousPriFile(projectRoot, platformVersion, defaultQualifiers, priFile, indexer)
#uselib "MrmSupport.dll"
#func global MrmCreateResourceIndexerFromPreviousPriFile "MrmCreateResourceIndexerFromPreviousPriFile" sptr, sptr, sptr, sptr, sptr
; MrmCreateResourceIndexerFromPreviousPriFile projectRoot, platformVersion, defaultQualifiers, priFile, varptr(indexer)   ; 戻り値は stat
; projectRoot : LPCWSTR -> "sptr"
; platformVersion : MrmPlatformVersion -> "sptr"
; defaultQualifiers : LPCWSTR optional -> "sptr"
; priFile : LPCWSTR -> "sptr"
; indexer : MrmResourceIndexerHandle* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MrmSupport.dll"
#cfunc global MrmCreateResourceIndexerFromPreviousPriFile "MrmCreateResourceIndexerFromPreviousPriFile" wstr, int, wstr, wstr, var
; res = MrmCreateResourceIndexerFromPreviousPriFile(projectRoot, platformVersion, defaultQualifiers, priFile, indexer)
; projectRoot : LPCWSTR -> "wstr"
; platformVersion : MrmPlatformVersion -> "int"
; defaultQualifiers : LPCWSTR optional -> "wstr"
; priFile : LPCWSTR -> "wstr"
; indexer : MrmResourceIndexerHandle* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT MrmCreateResourceIndexerFromPreviousPriFile(LPCWSTR projectRoot, MrmPlatformVersion platformVersion, LPCWSTR defaultQualifiers, LPCWSTR priFile, MrmResourceIndexerHandle* indexer)
#uselib "MrmSupport.dll"
#cfunc global MrmCreateResourceIndexerFromPreviousPriFile "MrmCreateResourceIndexerFromPreviousPriFile" wstr, int, wstr, wstr, var
; res = MrmCreateResourceIndexerFromPreviousPriFile(projectRoot, platformVersion, defaultQualifiers, priFile, indexer)
; projectRoot : LPCWSTR -> "wstr"
; platformVersion : MrmPlatformVersion -> "int"
; defaultQualifiers : LPCWSTR optional -> "wstr"
; priFile : LPCWSTR -> "wstr"
; indexer : MrmResourceIndexerHandle* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mrmsupport = windows.NewLazySystemDLL("MrmSupport.dll")
	procMrmCreateResourceIndexerFromPreviousPriFile = mrmsupport.NewProc("MrmCreateResourceIndexerFromPreviousPriFile")
)

// projectRoot (LPCWSTR), platformVersion (MrmPlatformVersion), defaultQualifiers (LPCWSTR optional), priFile (LPCWSTR), indexer (MrmResourceIndexerHandle* in/out)
r1, _, err := procMrmCreateResourceIndexerFromPreviousPriFile.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(projectRoot))),
	uintptr(platformVersion),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(defaultQualifiers))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(priFile))),
	uintptr(indexer),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function MrmCreateResourceIndexerFromPreviousPriFile(
  projectRoot: PWideChar;   // LPCWSTR
  platformVersion: Integer;   // MrmPlatformVersion
  defaultQualifiers: PWideChar;   // LPCWSTR optional
  priFile: PWideChar;   // LPCWSTR
  indexer: Pointer   // MrmResourceIndexerHandle* in/out
): Integer; stdcall;
  external 'MrmSupport.dll' name 'MrmCreateResourceIndexerFromPreviousPriFile';
result := DllCall("MrmSupport\MrmCreateResourceIndexerFromPreviousPriFile"
    , "WStr", projectRoot   ; LPCWSTR
    , "Int", platformVersion   ; MrmPlatformVersion
    , "WStr", defaultQualifiers   ; LPCWSTR optional
    , "WStr", priFile   ; LPCWSTR
    , "Ptr", indexer   ; MrmResourceIndexerHandle* in/out
    , "Int")   ; return: HRESULT
●MrmCreateResourceIndexerFromPreviousPriFile(projectRoot, platformVersion, defaultQualifiers, priFile, indexer) = DLL("MrmSupport.dll", "int MrmCreateResourceIndexerFromPreviousPriFile(char*, int, char*, char*, void*)")
# 呼び出し: MrmCreateResourceIndexerFromPreviousPriFile(projectRoot, platformVersion, defaultQualifiers, priFile, indexer)
# projectRoot : LPCWSTR -> "char*"
# platformVersion : MrmPlatformVersion -> "int"
# defaultQualifiers : LPCWSTR optional -> "char*"
# priFile : LPCWSTR -> "char*"
# indexer : MrmResourceIndexerHandle* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。