ホーム › System.Ole › UnRegisterTypeLib
UnRegisterTypeLib
関数指定したタイプライブラリの登録をシステムレジストリから削除する。
シグネチャ
// OLEAUT32.dll
#include <windows.h>
HRESULT UnRegisterTypeLib(
const GUID* libID,
WORD wVerMajor,
WORD wVerMinor,
DWORD lcid,
SYSKIND syskind
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| libID | GUID* | in |
| wVerMajor | WORD | in |
| wVerMinor | WORD | in |
| lcid | DWORD | in |
| syskind | SYSKIND | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// OLEAUT32.dll
#include <windows.h>
HRESULT UnRegisterTypeLib(
const GUID* libID,
WORD wVerMajor,
WORD wVerMinor,
DWORD lcid,
SYSKIND syskind
);[DllImport("OLEAUT32.dll", ExactSpelling = true)]
static extern int UnRegisterTypeLib(
ref Guid libID, // GUID*
ushort wVerMajor, // WORD
ushort wVerMinor, // WORD
uint lcid, // DWORD
int syskind // SYSKIND
);<DllImport("OLEAUT32.dll", ExactSpelling:=True)>
Public Shared Function UnRegisterTypeLib(
ByRef libID As Guid, ' GUID*
wVerMajor As UShort, ' WORD
wVerMinor As UShort, ' WORD
lcid As UInteger, ' DWORD
syskind As Integer ' SYSKIND
) As Integer
End Function' libID : GUID*
' wVerMajor : WORD
' wVerMinor : WORD
' lcid : DWORD
' syskind : SYSKIND
Declare PtrSafe Function UnRegisterTypeLib Lib "oleaut32" ( _
ByVal libID As LongPtr, _
ByVal wVerMajor As Integer, _
ByVal wVerMinor As Integer, _
ByVal lcid As Long, _
ByVal syskind As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
UnRegisterTypeLib = ctypes.windll.oleaut32.UnRegisterTypeLib
UnRegisterTypeLib.restype = ctypes.c_int
UnRegisterTypeLib.argtypes = [
ctypes.c_void_p, # libID : GUID*
ctypes.c_ushort, # wVerMajor : WORD
ctypes.c_ushort, # wVerMinor : WORD
wintypes.DWORD, # lcid : DWORD
ctypes.c_int, # syskind : SYSKIND
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLEAUT32.dll')
UnRegisterTypeLib = Fiddle::Function.new(
lib['UnRegisterTypeLib'],
[
Fiddle::TYPE_VOIDP, # libID : GUID*
-Fiddle::TYPE_SHORT, # wVerMajor : WORD
-Fiddle::TYPE_SHORT, # wVerMinor : WORD
-Fiddle::TYPE_INT, # lcid : DWORD
Fiddle::TYPE_INT, # syskind : SYSKIND
],
Fiddle::TYPE_INT)#[link(name = "oleaut32")]
extern "system" {
fn UnRegisterTypeLib(
libID: *const GUID, // GUID*
wVerMajor: u16, // WORD
wVerMinor: u16, // WORD
lcid: u32, // DWORD
syskind: i32 // SYSKIND
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLEAUT32.dll")]
public static extern int UnRegisterTypeLib(ref Guid libID, ushort wVerMajor, ushort wVerMinor, uint lcid, int syskind);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEAUT32_UnRegisterTypeLib' -Namespace Win32 -PassThru
# $api::UnRegisterTypeLib(libID, wVerMajor, wVerMinor, lcid, syskind)#uselib "OLEAUT32.dll"
#func global UnRegisterTypeLib "UnRegisterTypeLib" sptr, sptr, sptr, sptr, sptr
; UnRegisterTypeLib varptr(libID), wVerMajor, wVerMinor, lcid, syskind ; 戻り値は stat
; libID : GUID* -> "sptr"
; wVerMajor : WORD -> "sptr"
; wVerMinor : WORD -> "sptr"
; lcid : DWORD -> "sptr"
; syskind : SYSKIND -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "OLEAUT32.dll" #cfunc global UnRegisterTypeLib "UnRegisterTypeLib" var, int, int, int, int ; res = UnRegisterTypeLib(libID, wVerMajor, wVerMinor, lcid, syskind) ; libID : GUID* -> "var" ; wVerMajor : WORD -> "int" ; wVerMinor : WORD -> "int" ; lcid : DWORD -> "int" ; syskind : SYSKIND -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "OLEAUT32.dll" #cfunc global UnRegisterTypeLib "UnRegisterTypeLib" sptr, int, int, int, int ; res = UnRegisterTypeLib(varptr(libID), wVerMajor, wVerMinor, lcid, syskind) ; libID : GUID* -> "sptr" ; wVerMajor : WORD -> "int" ; wVerMinor : WORD -> "int" ; lcid : DWORD -> "int" ; syskind : SYSKIND -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT UnRegisterTypeLib(GUID* libID, WORD wVerMajor, WORD wVerMinor, DWORD lcid, SYSKIND syskind) #uselib "OLEAUT32.dll" #cfunc global UnRegisterTypeLib "UnRegisterTypeLib" var, int, int, int, int ; res = UnRegisterTypeLib(libID, wVerMajor, wVerMinor, lcid, syskind) ; libID : GUID* -> "var" ; wVerMajor : WORD -> "int" ; wVerMinor : WORD -> "int" ; lcid : DWORD -> "int" ; syskind : SYSKIND -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT UnRegisterTypeLib(GUID* libID, WORD wVerMajor, WORD wVerMinor, DWORD lcid, SYSKIND syskind) #uselib "OLEAUT32.dll" #cfunc global UnRegisterTypeLib "UnRegisterTypeLib" intptr, int, int, int, int ; res = UnRegisterTypeLib(varptr(libID), wVerMajor, wVerMinor, lcid, syskind) ; libID : GUID* -> "intptr" ; wVerMajor : WORD -> "int" ; wVerMinor : WORD -> "int" ; lcid : DWORD -> "int" ; syskind : SYSKIND -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
oleaut32 = windows.NewLazySystemDLL("OLEAUT32.dll")
procUnRegisterTypeLib = oleaut32.NewProc("UnRegisterTypeLib")
)
// libID (GUID*), wVerMajor (WORD), wVerMinor (WORD), lcid (DWORD), syskind (SYSKIND)
r1, _, err := procUnRegisterTypeLib.Call(
uintptr(libID),
uintptr(wVerMajor),
uintptr(wVerMinor),
uintptr(lcid),
uintptr(syskind),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction UnRegisterTypeLib(
libID: PGUID; // GUID*
wVerMajor: Word; // WORD
wVerMinor: Word; // WORD
lcid: DWORD; // DWORD
syskind: Integer // SYSKIND
): Integer; stdcall;
external 'OLEAUT32.dll' name 'UnRegisterTypeLib';result := DllCall("OLEAUT32\UnRegisterTypeLib"
, "Ptr", libID ; GUID*
, "UShort", wVerMajor ; WORD
, "UShort", wVerMinor ; WORD
, "UInt", lcid ; DWORD
, "Int", syskind ; SYSKIND
, "Int") ; return: HRESULT●UnRegisterTypeLib(libID, wVerMajor, wVerMinor, lcid, syskind) = DLL("OLEAUT32.dll", "int UnRegisterTypeLib(void*, int, int, dword, int)")
# 呼び出し: UnRegisterTypeLib(libID, wVerMajor, wVerMinor, lcid, syskind)
# libID : GUID* -> "void*"
# wVerMajor : WORD -> "int"
# wVerMinor : WORD -> "int"
# lcid : DWORD -> "dword"
# syskind : SYSKIND -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。