ホーム › Storage.Xps › DOCINFOA
DOCINFOA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | INT | 4 | +0 | +0 | この構造体のサイズをバイト単位で示す(ANSI版)。 |
| lpszDocName | LPSTR | 8/4 | +8 | +4 | 印刷ドキュメントの名前を表すANSI文字列。 |
| lpszOutput | LPSTR | 8/4 | +16 | +8 | 出力先(ファイル名等)を表すANSI文字列。NULLでプリンターポートへ出力。 |
| lpszDatatype | LPSTR | 8/4 | +24 | +12 | 印刷データの種類(RAW/EMF等)を表すANSI文字列。NULL可。 |
| fwType | DWORD | 4 | +32 | +16 | ドキュメントの追加情報を示すフラグ(DI_APPBANDING等)。 |
各言語での定義
#include <windows.h>
// DOCINFOA (x64 40 / x86 20 バイト)
typedef struct DOCINFOA {
INT cbSize;
LPSTR lpszDocName;
LPSTR lpszOutput;
LPSTR lpszDatatype;
DWORD fwType;
} DOCINFOA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOCINFOA
{
public int cbSize;
public IntPtr lpszDocName;
public IntPtr lpszOutput;
public IntPtr lpszDatatype;
public uint fwType;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOCINFOA
Public cbSize As Integer
Public lpszDocName As IntPtr
Public lpszOutput As IntPtr
Public lpszDatatype As IntPtr
Public fwType As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DOCINFOA(ctypes.Structure):
_fields_ = [
("cbSize", ctypes.c_int),
("lpszDocName", ctypes.c_void_p),
("lpszOutput", ctypes.c_void_p),
("lpszDatatype", ctypes.c_void_p),
("fwType", wintypes.DWORD),
]#[repr(C)]
pub struct DOCINFOA {
pub cbSize: i32,
pub lpszDocName: *mut core::ffi::c_void,
pub lpszOutput: *mut core::ffi::c_void,
pub lpszDatatype: *mut core::ffi::c_void,
pub fwType: u32,
}import "golang.org/x/sys/windows"
type DOCINFOA struct {
cbSize int32
lpszDocName uintptr
lpszOutput uintptr
lpszDatatype uintptr
fwType uint32
}type
DOCINFOA = record
cbSize: Integer;
lpszDocName: Pointer;
lpszOutput: Pointer;
lpszDatatype: Pointer;
fwType: DWORD;
end;const DOCINFOA = extern struct {
cbSize: i32,
lpszDocName: ?*anyopaque,
lpszOutput: ?*anyopaque,
lpszDatatype: ?*anyopaque,
fwType: u32,
};type
DOCINFOA {.bycopy.} = object
cbSize: int32
lpszDocName: pointer
lpszOutput: pointer
lpszDatatype: pointer
fwType: uint32struct DOCINFOA
{
int cbSize;
void* lpszDocName;
void* lpszOutput;
void* lpszDatatype;
uint fwType;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DOCINFOA サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbSize : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpszDocName : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpszOutput : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpszDatatype : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fwType : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOCINFOA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpszDocName : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpszOutput : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpszDatatype : LPSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; fwType : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DOCINFOA
#field int cbSize
#field intptr lpszDocName
#field intptr lpszOutput
#field intptr lpszDatatype
#field int fwType
#endstruct
stdim st, DOCINFOA ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize