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