ホーム › Storage.Cabinets › ERF
ERF
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| erfOper | INT | 4 | +0 | +0 | FCI/FDIの操作エラーコードを表す。 |
| erfType | INT | 4 | +4 | +4 | エラーに関連する追加情報(通常はerrno)を表す。 |
| fError | BOOL | 4 | +8 | +8 | エラーが発生したかを示すフラグ。 |
各言語での定義
#include <windows.h>
// ERF (x64 12 / x86 12 バイト)
typedef struct ERF {
INT erfOper;
INT erfType;
BOOL fError;
} ERF;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ERF
{
public int erfOper;
public int erfType;
[MarshalAs(UnmanagedType.Bool)] public bool fError;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ERF
Public erfOper As Integer
Public erfType As Integer
<MarshalAs(UnmanagedType.Bool)> Public fError As Boolean
End Structureimport ctypes
from ctypes import wintypes
class ERF(ctypes.Structure):
_fields_ = [
("erfOper", ctypes.c_int),
("erfType", ctypes.c_int),
("fError", wintypes.BOOL),
]#[repr(C)]
pub struct ERF {
pub erfOper: i32,
pub erfType: i32,
pub fError: i32,
}import "golang.org/x/sys/windows"
type ERF struct {
erfOper int32
erfType int32
fError int32
}type
ERF = record
erfOper: Integer;
erfType: Integer;
fError: BOOL;
end;const ERF = extern struct {
erfOper: i32,
erfType: i32,
fError: i32,
};type
ERF {.bycopy.} = object
erfOper: int32
erfType: int32
fError: int32struct ERF
{
int erfOper;
int erfType;
int fError;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ERF サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; erfOper : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; erfType : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fError : BOOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ERF
#field int erfOper
#field int erfType
#field bool fError
#endstruct
stdim st, ERF ; NSTRUCT 変数を確保
st->erfOper = 100
mes "erfOper=" + st->erfOper