Win32 API 日本語リファレンス
ホームSystem.Ole › OleDestroyMenuDescriptor

OleDestroyMenuDescriptor

関数
OLEメニュー記述子を破棄してリソースを解放する。
DLLOLE32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

HRESULT OleDestroyMenuDescriptor(
    INT_PTR holemenu
);

パラメーター

名前方向説明
holemenuINT_PTRin破棄するメニュー記述子(OleCreateMenuDescriptorの戻り値)。

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

OleDestroyMenuDescriptor = ctypes.windll.ole32.OleDestroyMenuDescriptor
OleDestroyMenuDescriptor.restype = ctypes.c_int
OleDestroyMenuDescriptor.argtypes = [
    ctypes.c_ssize_t,  # holemenu : INT_PTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	ole32 = windows.NewLazySystemDLL("OLE32.dll")
	procOleDestroyMenuDescriptor = ole32.NewProc("OleDestroyMenuDescriptor")
)

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