Win32 API 日本語リファレンス
ホームDevices.HumanInterfaceDevice › DIPOVCALIBRATION

DIPOVCALIBRATION

構造体
サイズx64: 40 バイト / x86: 40 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
lMinINT20+0+0POVキャリブレーションの最小値。
lMaxINT20+20+20POVキャリブレーションの最大値。

各言語での定義

#include <windows.h>

// DIPOVCALIBRATION  (x64 40 / x86 40 バイト)
typedef struct DIPOVCALIBRATION {
    INT lMin[5];
    INT lMax[5];
} DIPOVCALIBRATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DIPOVCALIBRATION
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public int[] lMin;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public int[] lMax;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DIPOVCALIBRATION
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public lMin() As Integer
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public lMax() As Integer
End Structure
import ctypes
from ctypes import wintypes

class DIPOVCALIBRATION(ctypes.Structure):
    _fields_ = [
        ("lMin", ctypes.c_int * 5),
        ("lMax", ctypes.c_int * 5),
    ]
#[repr(C)]
pub struct DIPOVCALIBRATION {
    pub lMin: [i32; 5],
    pub lMax: [i32; 5],
}
import "golang.org/x/sys/windows"

type DIPOVCALIBRATION struct {
	lMin [5]int32
	lMax [5]int32
}
type
  DIPOVCALIBRATION = record
    lMin: array[0..4] of Integer;
    lMax: array[0..4] of Integer;
  end;
const DIPOVCALIBRATION = extern struct {
    lMin: [5]i32,
    lMax: [5]i32,
};
type
  DIPOVCALIBRATION {.bycopy.} = object
    lMin: array[5, int32]
    lMax: array[5, int32]
struct DIPOVCALIBRATION
{
    int[5] lMin;
    int[5] lMax;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DIPOVCALIBRATION サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lMin : INT (+0, 20byte)  varptr(st)+0 を基点に操作(20byte:入れ子/配列)
; lMax : INT (+20, 20byte)  varptr(st)+20 を基点に操作(20byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DIPOVCALIBRATION
    #field int lMin 5
    #field int lMax 5
#endstruct

stdim st, DIPOVCALIBRATION        ; NSTRUCT 変数を確保