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

CreateResourceIndexer

関数
MRMリソースインデクサを作成する。
DLLMrmSupport.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

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

HRESULT CreateResourceIndexer(
    LPCWSTR projectRoot,
    LPCWSTR extensionDllPath,   // optional
    void** ppResourceIndexer
);

パラメーター

名前方向
projectRootLPCWSTRin
extensionDllPathLPCWSTRinoptional
ppResourceIndexervoid**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT CreateResourceIndexer(
    LPCWSTR projectRoot,
    LPCWSTR extensionDllPath,   // optional
    void** ppResourceIndexer
);
[DllImport("MrmSupport.dll", ExactSpelling = true)]
static extern int CreateResourceIndexer(
    [MarshalAs(UnmanagedType.LPWStr)] string projectRoot,   // LPCWSTR
    [MarshalAs(UnmanagedType.LPWStr)] string extensionDllPath,   // LPCWSTR optional
    IntPtr ppResourceIndexer   // void** out
);
<DllImport("MrmSupport.dll", ExactSpelling:=True)>
Public Shared Function CreateResourceIndexer(
    <MarshalAs(UnmanagedType.LPWStr)> projectRoot As String,   ' LPCWSTR
    <MarshalAs(UnmanagedType.LPWStr)> extensionDllPath As String,   ' LPCWSTR optional
    ppResourceIndexer As IntPtr   ' void** out
) As Integer
End Function
' projectRoot : LPCWSTR
' extensionDllPath : LPCWSTR optional
' ppResourceIndexer : void** out
Declare PtrSafe Function CreateResourceIndexer Lib "mrmsupport" ( _
    ByVal projectRoot As LongPtr, _
    ByVal extensionDllPath As LongPtr, _
    ByVal ppResourceIndexer As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CreateResourceIndexer = ctypes.windll.mrmsupport.CreateResourceIndexer
CreateResourceIndexer.restype = ctypes.c_int
CreateResourceIndexer.argtypes = [
    wintypes.LPCWSTR,  # projectRoot : LPCWSTR
    wintypes.LPCWSTR,  # extensionDllPath : LPCWSTR optional
    ctypes.c_void_p,  # ppResourceIndexer : void** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MrmSupport.dll')
CreateResourceIndexer = Fiddle::Function.new(
  lib['CreateResourceIndexer'],
  [
    Fiddle::TYPE_VOIDP,  # projectRoot : LPCWSTR
    Fiddle::TYPE_VOIDP,  # extensionDllPath : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # ppResourceIndexer : void** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mrmsupport")]
extern "system" {
    fn CreateResourceIndexer(
        projectRoot: *const u16,  // LPCWSTR
        extensionDllPath: *const u16,  // LPCWSTR optional
        ppResourceIndexer: *mut *mut ()  // void** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MrmSupport.dll")]
public static extern int CreateResourceIndexer([MarshalAs(UnmanagedType.LPWStr)] string projectRoot, [MarshalAs(UnmanagedType.LPWStr)] string extensionDllPath, IntPtr ppResourceIndexer);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MrmSupport_CreateResourceIndexer' -Namespace Win32 -PassThru
# $api::CreateResourceIndexer(projectRoot, extensionDllPath, ppResourceIndexer)
#uselib "MrmSupport.dll"
#func global CreateResourceIndexer "CreateResourceIndexer" sptr, sptr, sptr
; CreateResourceIndexer projectRoot, extensionDllPath, ppResourceIndexer   ; 戻り値は stat
; projectRoot : LPCWSTR -> "sptr"
; extensionDllPath : LPCWSTR optional -> "sptr"
; ppResourceIndexer : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MrmSupport.dll"
#cfunc global CreateResourceIndexer "CreateResourceIndexer" wstr, wstr, sptr
; res = CreateResourceIndexer(projectRoot, extensionDllPath, ppResourceIndexer)
; projectRoot : LPCWSTR -> "wstr"
; extensionDllPath : LPCWSTR optional -> "wstr"
; ppResourceIndexer : void** out -> "sptr"
; HRESULT CreateResourceIndexer(LPCWSTR projectRoot, LPCWSTR extensionDllPath, void** ppResourceIndexer)
#uselib "MrmSupport.dll"
#cfunc global CreateResourceIndexer "CreateResourceIndexer" wstr, wstr, intptr
; res = CreateResourceIndexer(projectRoot, extensionDllPath, ppResourceIndexer)
; projectRoot : LPCWSTR -> "wstr"
; extensionDllPath : LPCWSTR optional -> "wstr"
; ppResourceIndexer : void** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mrmsupport = windows.NewLazySystemDLL("MrmSupport.dll")
	procCreateResourceIndexer = mrmsupport.NewProc("CreateResourceIndexer")
)

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