ホーム › Devices.ImageAcquisition › WiaTransferParams
WiaTransferParams
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lMessage | INT | 4 | +0 | +0 | 転送中に通知されるメッセージ種別を示す値。 |
| lPercentComplete | INT | 4 | +4 | +4 | 転送の進捗率(0〜100)。 |
| ulTransferredBytes | ULONGLONG | 8 | +8 | +8 | これまでに転送されたバイト数(64ビット)。 |
| hrErrorStatus | HRESULT | 4 | +16 | +16 | 転送のエラー状態を示すHRESULT。 |
各言語での定義
#include <windows.h>
// WiaTransferParams (x64 24 / x86 24 バイト)
typedef struct WiaTransferParams {
INT lMessage;
INT lPercentComplete;
ULONGLONG ulTransferredBytes;
HRESULT hrErrorStatus;
} WiaTransferParams;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WiaTransferParams
{
public int lMessage;
public int lPercentComplete;
public ulong ulTransferredBytes;
public int hrErrorStatus;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WiaTransferParams
Public lMessage As Integer
Public lPercentComplete As Integer
Public ulTransferredBytes As ULong
Public hrErrorStatus As Integer
End Structureimport ctypes
from ctypes import wintypes
class WiaTransferParams(ctypes.Structure):
_fields_ = [
("lMessage", ctypes.c_int),
("lPercentComplete", ctypes.c_int),
("ulTransferredBytes", ctypes.c_ulonglong),
("hrErrorStatus", ctypes.c_int),
]#[repr(C)]
pub struct WiaTransferParams {
pub lMessage: i32,
pub lPercentComplete: i32,
pub ulTransferredBytes: u64,
pub hrErrorStatus: i32,
}import "golang.org/x/sys/windows"
type WiaTransferParams struct {
lMessage int32
lPercentComplete int32
ulTransferredBytes uint64
hrErrorStatus int32
}type
WiaTransferParams = record
lMessage: Integer;
lPercentComplete: Integer;
ulTransferredBytes: UInt64;
hrErrorStatus: Integer;
end;const WiaTransferParams = extern struct {
lMessage: i32,
lPercentComplete: i32,
ulTransferredBytes: u64,
hrErrorStatus: i32,
};type
WiaTransferParams {.bycopy.} = object
lMessage: int32
lPercentComplete: int32
ulTransferredBytes: uint64
hrErrorStatus: int32struct WiaTransferParams
{
int lMessage;
int lPercentComplete;
ulong ulTransferredBytes;
int hrErrorStatus;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WiaTransferParams サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; lMessage : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lPercentComplete : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ulTransferredBytes : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hrErrorStatus : HRESULT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WiaTransferParams
#field int lMessage
#field int lPercentComplete
#field int64 ulTransferredBytes
#field int hrErrorStatus
#endstruct
stdim st, WiaTransferParams ; NSTRUCT 変数を確保
st->lMessage = 100
mes "lMessage=" + st->lMessage