JsDeleteProperty
関数オブジェクトの指定プロパティを削除する。
シグネチャ
// chakra.dll
#include <windows.h>
JsErrorCode JsDeleteProperty(
void* object,
void* propertyId,
BYTE useStrictRules,
void** result
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| object | void* | in |
| propertyId | void* | in |
| useStrictRules | BYTE | in |
| result | void** | out |
戻り値の型: JsErrorCode
各言語での呼び出し定義
// chakra.dll
#include <windows.h>
JsErrorCode JsDeleteProperty(
void* object,
void* propertyId,
BYTE useStrictRules,
void** result
);[DllImport("chakra.dll", ExactSpelling = true)]
static extern uint JsDeleteProperty(
IntPtr object, // void*
IntPtr propertyId, // void*
byte useStrictRules, // BYTE
IntPtr result // void** out
);<DllImport("chakra.dll", ExactSpelling:=True)>
Public Shared Function JsDeleteProperty(
[object] As IntPtr, ' void*
propertyId As IntPtr, ' void*
useStrictRules As Byte, ' BYTE
result As IntPtr ' void** out
) As UInteger
End Function' object : void*
' propertyId : void*
' useStrictRules : BYTE
' result : void** out
Declare PtrSafe Function JsDeleteProperty Lib "chakra" ( _
ByVal object As LongPtr, _
ByVal propertyId As LongPtr, _
ByVal useStrictRules As Byte, _
ByVal result As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JsDeleteProperty = ctypes.windll.chakra.JsDeleteProperty
JsDeleteProperty.restype = wintypes.DWORD
JsDeleteProperty.argtypes = [
ctypes.POINTER(None), # object : void*
ctypes.POINTER(None), # propertyId : void*
ctypes.c_ubyte, # useStrictRules : BYTE
ctypes.c_void_p, # result : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('chakra.dll')
JsDeleteProperty = Fiddle::Function.new(
lib['JsDeleteProperty'],
[
Fiddle::TYPE_VOIDP, # object : void*
Fiddle::TYPE_VOIDP, # propertyId : void*
-Fiddle::TYPE_CHAR, # useStrictRules : BYTE
Fiddle::TYPE_VOIDP, # result : void** out
],
-Fiddle::TYPE_INT)#[link(name = "chakra")]
extern "system" {
fn JsDeleteProperty(
object: *mut (), // void*
propertyId: *mut (), // void*
useStrictRules: u8, // BYTE
result: *mut *mut () // void** out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("chakra.dll")]
public static extern uint JsDeleteProperty(IntPtr object, IntPtr propertyId, byte useStrictRules, IntPtr result);
"@
$api = Add-Type -MemberDefinition $sig -Name 'chakra_JsDeleteProperty' -Namespace Win32 -PassThru
# $api::JsDeleteProperty(object, propertyId, useStrictRules, result)#uselib "chakra.dll"
#func global JsDeleteProperty "JsDeleteProperty" sptr, sptr, sptr, sptr
; JsDeleteProperty object, propertyId, useStrictRules, result ; 戻り値は stat
; object : void* -> "sptr"
; propertyId : void* -> "sptr"
; useStrictRules : BYTE -> "sptr"
; result : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "chakra.dll"
#cfunc global JsDeleteProperty "JsDeleteProperty" sptr, sptr, int, sptr
; res = JsDeleteProperty(object, propertyId, useStrictRules, result)
; object : void* -> "sptr"
; propertyId : void* -> "sptr"
; useStrictRules : BYTE -> "int"
; result : void** out -> "sptr"; JsErrorCode JsDeleteProperty(void* object, void* propertyId, BYTE useStrictRules, void** result)
#uselib "chakra.dll"
#cfunc global JsDeleteProperty "JsDeleteProperty" intptr, intptr, int, intptr
; res = JsDeleteProperty(object, propertyId, useStrictRules, result)
; object : void* -> "intptr"
; propertyId : void* -> "intptr"
; useStrictRules : BYTE -> "int"
; result : void** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
chakra = windows.NewLazySystemDLL("chakra.dll")
procJsDeleteProperty = chakra.NewProc("JsDeleteProperty")
)
// object (void*), propertyId (void*), useStrictRules (BYTE), result (void** out)
r1, _, err := procJsDeleteProperty.Call(
uintptr(object),
uintptr(propertyId),
uintptr(useStrictRules),
uintptr(result),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // JsErrorCodefunction JsDeleteProperty(
object: Pointer; // void*
propertyId: Pointer; // void*
useStrictRules: Byte; // BYTE
result: Pointer // void** out
): DWORD; stdcall;
external 'chakra.dll' name 'JsDeleteProperty';result := DllCall("chakra\JsDeleteProperty"
, "Ptr", object ; void*
, "Ptr", propertyId ; void*
, "UChar", useStrictRules ; BYTE
, "Ptr", result ; void** out
, "UInt") ; return: JsErrorCode●JsDeleteProperty(object, propertyId, useStrictRules, result) = DLL("chakra.dll", "dword JsDeleteProperty(void*, void*, byte, void*)")
# 呼び出し: JsDeleteProperty(object, propertyId, useStrictRules, result)
# object : void* -> "void*"
# propertyId : void* -> "void*"
# useStrictRules : BYTE -> "byte"
# result : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。