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

CoSuspendClassObjects

関数
クラスオブジェクトへの新規接続要求を一時停止する。
DLLOLE32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

HRESULT CoSuspendClassObjects(void);

パラメーターなし。戻り値: HRESULT

各言語での呼び出し定義

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

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

CoSuspendClassObjects = ctypes.windll.ole32.CoSuspendClassObjects
CoSuspendClassObjects.restype = ctypes.c_int
CoSuspendClassObjects.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	ole32 = windows.NewLazySystemDLL("OLE32.dll")
	procCoSuspendClassObjects = ole32.NewProc("CoSuspendClassObjects")
)

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