ホーム › Graphics.Printing › OIEXT
OIEXT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | WORD | 2 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| Flags | WORD | 2 | +2 | +2 | 拡張オプション項目の動作を制御するビットフラグ。 |
| hInstCaller | HINSTANCE | 8/4 | +8 | +4 | 呼び出し元モジュールのインスタンスハンドル。ヘルプファイル参照等に用いる。 |
| pHelpFile | CHAR* | 8/4 | +16 | +8 | この項目に対応するヘルプファイルのパスへのポインタ。NULL可。 |
| dwReserved | UINT_PTR | 32/16 | +24 | +12 | 予約フィールド。0を設定する。 |
各言語での定義
#include <windows.h>
// OIEXT (x64 56 / x86 28 バイト)
typedef struct OIEXT {
WORD cbSize;
WORD Flags;
HINSTANCE hInstCaller;
CHAR* pHelpFile;
UINT_PTR dwReserved[4];
} OIEXT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OIEXT
{
public ushort cbSize;
public ushort Flags;
public IntPtr hInstCaller;
public IntPtr pHelpFile;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public UIntPtr[] dwReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OIEXT
Public cbSize As UShort
Public Flags As UShort
Public hInstCaller As IntPtr
Public pHelpFile As IntPtr
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public dwReserved() As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class OIEXT(ctypes.Structure):
_fields_ = [
("cbSize", ctypes.c_ushort),
("Flags", ctypes.c_ushort),
("hInstCaller", ctypes.c_void_p),
("pHelpFile", ctypes.c_void_p),
("dwReserved", ctypes.c_size_t * 4),
]#[repr(C)]
pub struct OIEXT {
pub cbSize: u16,
pub Flags: u16,
pub hInstCaller: *mut core::ffi::c_void,
pub pHelpFile: *mut core::ffi::c_void,
pub dwReserved: [usize; 4],
}import "golang.org/x/sys/windows"
type OIEXT struct {
cbSize uint16
Flags uint16
hInstCaller uintptr
pHelpFile uintptr
dwReserved [4]uintptr
}type
OIEXT = record
cbSize: Word;
Flags: Word;
hInstCaller: Pointer;
pHelpFile: Pointer;
dwReserved: array[0..3] of NativeUInt;
end;const OIEXT = extern struct {
cbSize: u16,
Flags: u16,
hInstCaller: ?*anyopaque,
pHelpFile: ?*anyopaque,
dwReserved: [4]usize,
};type
OIEXT {.bycopy.} = object
cbSize: uint16
Flags: uint16
hInstCaller: pointer
pHelpFile: pointer
dwReserved: array[4, uint]struct OIEXT
{
ushort cbSize;
ushort Flags;
void* hInstCaller;
void* pHelpFile;
size_t[4] dwReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OIEXT サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Flags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; hInstCaller : HINSTANCE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pHelpFile : CHAR* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwReserved : UINT_PTR (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OIEXT サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Flags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; hInstCaller : HINSTANCE (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pHelpFile : CHAR* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwReserved : UINT_PTR (+24, 32byte) varptr(st)+24 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OIEXT
#field short cbSize
#field short Flags
#field intptr hInstCaller
#field intptr pHelpFile
#field intptr dwReserved 4
#endstruct
stdim st, OIEXT ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize