ホーム › Devices.ImageAcquisition › WIAS_CHANGED_VALUE_INFO
WIAS_CHANGED_VALUE_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| bChanged | BOOL | 4 | +0 | +0 | プロパティ値が変更されたかを示すBOOL。 |
| vt | INT | 4 | +4 | +4 | 値のVARIANT型を示す値。 |
| Old | _Old_e__Union | 16 | +8 | +8 | 変更前の値を保持する無名共用体。 |
| Current | _Current_e__Union | 16 | +24 | +24 | 変更後(現在)の値を保持する無名共用体。 |
共用体: _Old_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| lVal | INT | 4 | +0 | +0 |
| fltVal | FLOAT | 4 | +0 | +0 |
| bstrVal | LPWSTR | 8/4 | +0 | +0 |
| guidVal | GUID | 16 | +0 | +0 |
共用体: _Current_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| lVal | INT | 4 | +0 | +0 |
| fltVal | FLOAT | 4 | +0 | +0 |
| bstrVal | LPWSTR | 8/4 | +0 | +0 |
| guidVal | GUID | 16 | +0 | +0 |
各言語での定義
#include <windows.h>
// WIAS_CHANGED_VALUE_INFO (x64 40 / x86 40 バイト)
typedef struct WIAS_CHANGED_VALUE_INFO {
BOOL bChanged;
INT vt;
_Old_e__Union Old;
_Current_e__Union Current;
} WIAS_CHANGED_VALUE_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIAS_CHANGED_VALUE_INFO
{
[MarshalAs(UnmanagedType.Bool)] public bool bChanged;
public int vt;
public _Old_e__Union Old;
public _Current_e__Union Current;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WIAS_CHANGED_VALUE_INFO
<MarshalAs(UnmanagedType.Bool)> Public bChanged As Boolean
Public vt As Integer
Public Old As _Old_e__Union
Public Current As _Current_e__Union
End Structureimport ctypes
from ctypes import wintypes
class WIAS_CHANGED_VALUE_INFO(ctypes.Structure):
_fields_ = [
("bChanged", wintypes.BOOL),
("vt", ctypes.c_int),
("Old", _Old_e__Union),
("Current", _Current_e__Union),
]#[repr(C)]
pub struct WIAS_CHANGED_VALUE_INFO {
pub bChanged: i32,
pub vt: i32,
pub Old: _Old_e__Union,
pub Current: _Current_e__Union,
}import "golang.org/x/sys/windows"
type WIAS_CHANGED_VALUE_INFO struct {
bChanged int32
vt int32
Old _Old_e__Union
Current _Current_e__Union
}type
WIAS_CHANGED_VALUE_INFO = record
bChanged: BOOL;
vt: Integer;
Old: _Old_e__Union;
Current: _Current_e__Union;
end;const WIAS_CHANGED_VALUE_INFO = extern struct {
bChanged: i32,
vt: i32,
Old: _Old_e__Union,
Current: _Current_e__Union,
};type
WIAS_CHANGED_VALUE_INFO {.bycopy.} = object
bChanged: int32
vt: int32
Old: _Old_e__Union
Current: _Current_e__Unionstruct WIAS_CHANGED_VALUE_INFO
{
int bChanged;
int vt;
_Old_e__Union Old;
_Current_e__Union Current;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WIAS_CHANGED_VALUE_INFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; bChanged : BOOL (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; vt : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Old : _Old_e__Union (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; Current : _Current_e__Union (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WIAS_CHANGED_VALUE_INFO
#field bool bChanged
#field int vt
#field byte Old 16
#field byte Current 16
#endstruct
stdim st, WIAS_CHANGED_VALUE_INFO ; NSTRUCT 変数を確保
st->bChanged = 100
mes "bChanged=" + st->bChanged
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。