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

CoTestCancel

関数
現在の呼び出しにキャンセル要求があるか確認する。
DLLOLE32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

HRESULT CoTestCancel(void);

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

各言語での呼び出し定義

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

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

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

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

var (
	ole32 = windows.NewLazySystemDLL("OLE32.dll")
	procCoTestCancel = ole32.NewProc("CoTestCancel")
)

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