ホーム › Storage.Jet › JET_COLUMNBASE_A
JET_COLUMNBASE_A
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| columnid | DWORD | 4 | +4 | +4 | 列の識別子。 |
| coltyp | DWORD | 4 | +8 | +8 | 列のデータ型を示す値。 |
| wCountry | WORD | 2 | +12 | +12 | 国コード(非推奨)。 |
| langid | WORD | 2 | +14 | +14 | テキスト列の言語ID(LANGID)。 |
| cp | WORD | 2 | +16 | +16 | テキスト列のコードページ。 |
| wFiller | WORD | 2 | +18 | +18 | アラインメント用のパディング(未使用)。 |
| cbMax | DWORD | 4 | +20 | +20 | 列に格納可能な最大バイト長。 |
| grbit | DWORD | 4 | +24 | +24 | 列の属性を示すフラグ群。 |
| szBaseTableName | CHAR | 256 | +28 | +28 | 基底テーブル名を保持する固定長CHAR配列(ANSI)。 |
| szBaseColumnName | CHAR | 256 | +284 | +284 | 基底列名を保持する固定長CHAR配列(ANSI)。 |
各言語での定義
#include <windows.h>
// JET_COLUMNBASE_A (x64 540 / x86 540 バイト)
typedef struct JET_COLUMNBASE_A {
DWORD cbStruct;
DWORD columnid;
DWORD coltyp;
WORD wCountry;
WORD langid;
WORD cp;
WORD wFiller;
DWORD cbMax;
DWORD grbit;
CHAR szBaseTableName[256];
CHAR szBaseColumnName[256];
} JET_COLUMNBASE_A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_COLUMNBASE_A
{
public uint cbStruct;
public uint columnid;
public uint coltyp;
public ushort wCountry;
public ushort langid;
public ushort cp;
public ushort wFiller;
public uint cbMax;
public uint grbit;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public sbyte[] szBaseTableName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public sbyte[] szBaseColumnName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_COLUMNBASE_A
Public cbStruct As UInteger
Public columnid As UInteger
Public coltyp As UInteger
Public wCountry As UShort
Public langid As UShort
Public cp As UShort
Public wFiller As UShort
Public cbMax As UInteger
Public grbit As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public szBaseTableName() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public szBaseColumnName() As SByte
End Structureimport ctypes
from ctypes import wintypes
class JET_COLUMNBASE_A(ctypes.Structure):
_fields_ = [
("cbStruct", wintypes.DWORD),
("columnid", wintypes.DWORD),
("coltyp", wintypes.DWORD),
("wCountry", ctypes.c_ushort),
("langid", ctypes.c_ushort),
("cp", ctypes.c_ushort),
("wFiller", ctypes.c_ushort),
("cbMax", wintypes.DWORD),
("grbit", wintypes.DWORD),
("szBaseTableName", ctypes.c_byte * 256),
("szBaseColumnName", ctypes.c_byte * 256),
]#[repr(C)]
pub struct JET_COLUMNBASE_A {
pub cbStruct: u32,
pub columnid: u32,
pub coltyp: u32,
pub wCountry: u16,
pub langid: u16,
pub cp: u16,
pub wFiller: u16,
pub cbMax: u32,
pub grbit: u32,
pub szBaseTableName: [i8; 256],
pub szBaseColumnName: [i8; 256],
}import "golang.org/x/sys/windows"
type JET_COLUMNBASE_A struct {
cbStruct uint32
columnid uint32
coltyp uint32
wCountry uint16
langid uint16
cp uint16
wFiller uint16
cbMax uint32
grbit uint32
szBaseTableName [256]int8
szBaseColumnName [256]int8
}type
JET_COLUMNBASE_A = record
cbStruct: DWORD;
columnid: DWORD;
coltyp: DWORD;
wCountry: Word;
langid: Word;
cp: Word;
wFiller: Word;
cbMax: DWORD;
grbit: DWORD;
szBaseTableName: array[0..255] of Shortint;
szBaseColumnName: array[0..255] of Shortint;
end;const JET_COLUMNBASE_A = extern struct {
cbStruct: u32,
columnid: u32,
coltyp: u32,
wCountry: u16,
langid: u16,
cp: u16,
wFiller: u16,
cbMax: u32,
grbit: u32,
szBaseTableName: [256]i8,
szBaseColumnName: [256]i8,
};type
JET_COLUMNBASE_A {.bycopy.} = object
cbStruct: uint32
columnid: uint32
coltyp: uint32
wCountry: uint16
langid: uint16
cp: uint16
wFiller: uint16
cbMax: uint32
grbit: uint32
szBaseTableName: array[256, int8]
szBaseColumnName: array[256, int8]struct JET_COLUMNBASE_A
{
uint cbStruct;
uint columnid;
uint coltyp;
ushort wCountry;
ushort langid;
ushort cp;
ushort wFiller;
uint cbMax;
uint grbit;
byte[256] szBaseTableName;
byte[256] szBaseColumnName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_COLUMNBASE_A サイズ: 540 バイト(x64)
dim st, 135 ; 4byte整数×135(構造体サイズ 540 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; columnid : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; coltyp : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wCountry : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; langid : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; cp : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; wFiller : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; cbMax : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; grbit : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; szBaseTableName : CHAR (+28, 256byte) varptr(st)+28 を基点に操作(256byte:入れ子/配列)
; szBaseColumnName : CHAR (+284, 256byte) varptr(st)+284 を基点に操作(256byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_COLUMNBASE_A
#field int cbStruct
#field int columnid
#field int coltyp
#field short wCountry
#field short langid
#field short cp
#field short wFiller
#field int cbMax
#field int grbit
#field char szBaseTableName 256
#field char szBaseColumnName 256
#endstruct
stdim st, JET_COLUMNBASE_A ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct