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