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