Win32 API 日本語リファレンス
ホームSystem.Com.Urlmon › RevokeFormatEnumerator

RevokeFormatEnumerator

関数
バインドコンテキストから登録済みの形式列挙子を解除する。
DLLurlmon.dll呼出規約winapi

シグネチャ

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

HRESULT RevokeFormatEnumerator(
    IBindCtx* pBC,
    IEnumFORMATETC* pEFetc
);

パラメーター

名前方向
pBCIBindCtx*in
pEFetcIEnumFORMATETC*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT RevokeFormatEnumerator(
    IBindCtx* pBC,
    IEnumFORMATETC* pEFetc
);
[DllImport("urlmon.dll", ExactSpelling = true)]
static extern int RevokeFormatEnumerator(
    IntPtr pBC,   // IBindCtx*
    IntPtr pEFetc   // IEnumFORMATETC*
);
<DllImport("urlmon.dll", ExactSpelling:=True)>
Public Shared Function RevokeFormatEnumerator(
    pBC As IntPtr,   ' IBindCtx*
    pEFetc As IntPtr   ' IEnumFORMATETC*
) As Integer
End Function
' pBC : IBindCtx*
' pEFetc : IEnumFORMATETC*
Declare PtrSafe Function RevokeFormatEnumerator Lib "urlmon" ( _
    ByVal pBC As LongPtr, _
    ByVal pEFetc As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RevokeFormatEnumerator = ctypes.windll.urlmon.RevokeFormatEnumerator
RevokeFormatEnumerator.restype = ctypes.c_int
RevokeFormatEnumerator.argtypes = [
    ctypes.c_void_p,  # pBC : IBindCtx*
    ctypes.c_void_p,  # pEFetc : IEnumFORMATETC*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('urlmon.dll')
RevokeFormatEnumerator = Fiddle::Function.new(
  lib['RevokeFormatEnumerator'],
  [
    Fiddle::TYPE_VOIDP,  # pBC : IBindCtx*
    Fiddle::TYPE_VOIDP,  # pEFetc : IEnumFORMATETC*
  ],
  Fiddle::TYPE_INT)
#[link(name = "urlmon")]
extern "system" {
    fn RevokeFormatEnumerator(
        pBC: *mut core::ffi::c_void,  // IBindCtx*
        pEFetc: *mut core::ffi::c_void  // IEnumFORMATETC*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("urlmon.dll")]
public static extern int RevokeFormatEnumerator(IntPtr pBC, IntPtr pEFetc);
"@
$api = Add-Type -MemberDefinition $sig -Name 'urlmon_RevokeFormatEnumerator' -Namespace Win32 -PassThru
# $api::RevokeFormatEnumerator(pBC, pEFetc)
#uselib "urlmon.dll"
#func global RevokeFormatEnumerator "RevokeFormatEnumerator" sptr, sptr
; RevokeFormatEnumerator pBC, pEFetc   ; 戻り値は stat
; pBC : IBindCtx* -> "sptr"
; pEFetc : IEnumFORMATETC* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "urlmon.dll"
#cfunc global RevokeFormatEnumerator "RevokeFormatEnumerator" sptr, sptr
; res = RevokeFormatEnumerator(pBC, pEFetc)
; pBC : IBindCtx* -> "sptr"
; pEFetc : IEnumFORMATETC* -> "sptr"
; HRESULT RevokeFormatEnumerator(IBindCtx* pBC, IEnumFORMATETC* pEFetc)
#uselib "urlmon.dll"
#cfunc global RevokeFormatEnumerator "RevokeFormatEnumerator" intptr, intptr
; res = RevokeFormatEnumerator(pBC, pEFetc)
; pBC : IBindCtx* -> "intptr"
; pEFetc : IEnumFORMATETC* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	urlmon = windows.NewLazySystemDLL("urlmon.dll")
	procRevokeFormatEnumerator = urlmon.NewProc("RevokeFormatEnumerator")
)

// pBC (IBindCtx*), pEFetc (IEnumFORMATETC*)
r1, _, err := procRevokeFormatEnumerator.Call(
	uintptr(pBC),
	uintptr(pEFetc),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function RevokeFormatEnumerator(
  pBC: Pointer;   // IBindCtx*
  pEFetc: Pointer   // IEnumFORMATETC*
): Integer; stdcall;
  external 'urlmon.dll' name 'RevokeFormatEnumerator';
result := DllCall("urlmon\RevokeFormatEnumerator"
    , "Ptr", pBC   ; IBindCtx*
    , "Ptr", pEFetc   ; IEnumFORMATETC*
    , "Int")   ; return: HRESULT
●RevokeFormatEnumerator(pBC, pEFetc) = DLL("urlmon.dll", "int RevokeFormatEnumerator(void*, void*)")
# 呼び出し: RevokeFormatEnumerator(pBC, pEFetc)
# pBC : IBindCtx* -> "void*"
# pEFetc : IEnumFORMATETC* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。