ホーム › System.Com › MonikerRelativePathTo
MonikerRelativePathTo
関数二つのモニカー間の相対パスモニカーを生成する。
シグネチャ
// ole32.dll
#include <windows.h>
HRESULT MonikerRelativePathTo(
IMoniker* pmkSrc,
IMoniker* pmkDest,
IMoniker** ppmkRelPath,
BOOL dwReserved
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pmkSrc | IMoniker* | in |
| pmkDest | IMoniker* | in |
| ppmkRelPath | IMoniker** | out |
| dwReserved | BOOL | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// ole32.dll
#include <windows.h>
HRESULT MonikerRelativePathTo(
IMoniker* pmkSrc,
IMoniker* pmkDest,
IMoniker** ppmkRelPath,
BOOL dwReserved
);[DllImport("ole32.dll", ExactSpelling = true)]
static extern int MonikerRelativePathTo(
IntPtr pmkSrc, // IMoniker*
IntPtr pmkDest, // IMoniker*
IntPtr ppmkRelPath, // IMoniker** out
bool dwReserved // BOOL
);<DllImport("ole32.dll", ExactSpelling:=True)>
Public Shared Function MonikerRelativePathTo(
pmkSrc As IntPtr, ' IMoniker*
pmkDest As IntPtr, ' IMoniker*
ppmkRelPath As IntPtr, ' IMoniker** out
dwReserved As Boolean ' BOOL
) As Integer
End Function' pmkSrc : IMoniker*
' pmkDest : IMoniker*
' ppmkRelPath : IMoniker** out
' dwReserved : BOOL
Declare PtrSafe Function MonikerRelativePathTo Lib "ole32" ( _
ByVal pmkSrc As LongPtr, _
ByVal pmkDest As LongPtr, _
ByVal ppmkRelPath As LongPtr, _
ByVal dwReserved As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MonikerRelativePathTo = ctypes.windll.ole32.MonikerRelativePathTo
MonikerRelativePathTo.restype = ctypes.c_int
MonikerRelativePathTo.argtypes = [
ctypes.c_void_p, # pmkSrc : IMoniker*
ctypes.c_void_p, # pmkDest : IMoniker*
ctypes.c_void_p, # ppmkRelPath : IMoniker** out
wintypes.BOOL, # dwReserved : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ole32.dll')
MonikerRelativePathTo = Fiddle::Function.new(
lib['MonikerRelativePathTo'],
[
Fiddle::TYPE_VOIDP, # pmkSrc : IMoniker*
Fiddle::TYPE_VOIDP, # pmkDest : IMoniker*
Fiddle::TYPE_VOIDP, # ppmkRelPath : IMoniker** out
Fiddle::TYPE_INT, # dwReserved : BOOL
],
Fiddle::TYPE_INT)#[link(name = "ole32")]
extern "system" {
fn MonikerRelativePathTo(
pmkSrc: *mut core::ffi::c_void, // IMoniker*
pmkDest: *mut core::ffi::c_void, // IMoniker*
ppmkRelPath: *mut *mut core::ffi::c_void, // IMoniker** out
dwReserved: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ole32.dll")]
public static extern int MonikerRelativePathTo(IntPtr pmkSrc, IntPtr pmkDest, IntPtr ppmkRelPath, bool dwReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ole32_MonikerRelativePathTo' -Namespace Win32 -PassThru
# $api::MonikerRelativePathTo(pmkSrc, pmkDest, ppmkRelPath, dwReserved)#uselib "ole32.dll"
#func global MonikerRelativePathTo "MonikerRelativePathTo" sptr, sptr, sptr, sptr
; MonikerRelativePathTo pmkSrc, pmkDest, ppmkRelPath, dwReserved ; 戻り値は stat
; pmkSrc : IMoniker* -> "sptr"
; pmkDest : IMoniker* -> "sptr"
; ppmkRelPath : IMoniker** out -> "sptr"
; dwReserved : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ole32.dll"
#cfunc global MonikerRelativePathTo "MonikerRelativePathTo" sptr, sptr, sptr, int
; res = MonikerRelativePathTo(pmkSrc, pmkDest, ppmkRelPath, dwReserved)
; pmkSrc : IMoniker* -> "sptr"
; pmkDest : IMoniker* -> "sptr"
; ppmkRelPath : IMoniker** out -> "sptr"
; dwReserved : BOOL -> "int"; HRESULT MonikerRelativePathTo(IMoniker* pmkSrc, IMoniker* pmkDest, IMoniker** ppmkRelPath, BOOL dwReserved)
#uselib "ole32.dll"
#cfunc global MonikerRelativePathTo "MonikerRelativePathTo" intptr, intptr, intptr, int
; res = MonikerRelativePathTo(pmkSrc, pmkDest, ppmkRelPath, dwReserved)
; pmkSrc : IMoniker* -> "intptr"
; pmkDest : IMoniker* -> "intptr"
; ppmkRelPath : IMoniker** out -> "intptr"
; dwReserved : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ole32 = windows.NewLazySystemDLL("ole32.dll")
procMonikerRelativePathTo = ole32.NewProc("MonikerRelativePathTo")
)
// pmkSrc (IMoniker*), pmkDest (IMoniker*), ppmkRelPath (IMoniker** out), dwReserved (BOOL)
r1, _, err := procMonikerRelativePathTo.Call(
uintptr(pmkSrc),
uintptr(pmkDest),
uintptr(ppmkRelPath),
uintptr(dwReserved),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MonikerRelativePathTo(
pmkSrc: Pointer; // IMoniker*
pmkDest: Pointer; // IMoniker*
ppmkRelPath: Pointer; // IMoniker** out
dwReserved: BOOL // BOOL
): Integer; stdcall;
external 'ole32.dll' name 'MonikerRelativePathTo';result := DllCall("ole32\MonikerRelativePathTo"
, "Ptr", pmkSrc ; IMoniker*
, "Ptr", pmkDest ; IMoniker*
, "Ptr", ppmkRelPath ; IMoniker** out
, "Int", dwReserved ; BOOL
, "Int") ; return: HRESULT●MonikerRelativePathTo(pmkSrc, pmkDest, ppmkRelPath, dwReserved) = DLL("ole32.dll", "int MonikerRelativePathTo(void*, void*, void*, bool)")
# 呼び出し: MonikerRelativePathTo(pmkSrc, pmkDest, ppmkRelPath, dwReserved)
# pmkSrc : IMoniker* -> "void*"
# pmkDest : IMoniker* -> "void*"
# ppmkRelPath : IMoniker** out -> "void*"
# dwReserved : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。