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