ホーム › System.Search › DBCOST
DBCOST
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| eKind | DWORD | 4 | +0 | +0 | コスト見積もりの種類を示す値。 |
| dwUnits | DWORD | 4 | +4 | +4 | コストの単位を示す値。 |
| lValue | INT | 4 | +8 | +8 | 見積もられたコスト値(符号付き整数)。 |
各言語での定義
#include <windows.h>
// DBCOST (x64 12 / x86 12 バイト)
#pragma pack(push, 2)
typedef struct DBCOST {
DWORD eKind;
DWORD dwUnits;
INT lValue;
} DBCOST;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct DBCOST
{
public uint eKind;
public uint dwUnits;
public int lValue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure DBCOST
Public eKind As UInteger
Public dwUnits As UInteger
Public lValue As Integer
End Structureimport ctypes
from ctypes import wintypes
class DBCOST(ctypes.Structure):
_pack_ = 2
_fields_ = [
("eKind", wintypes.DWORD),
("dwUnits", wintypes.DWORD),
("lValue", ctypes.c_int),
]#[repr(C, packed(2))]
pub struct DBCOST {
pub eKind: u32,
pub dwUnits: u32,
pub lValue: i32,
}import "golang.org/x/sys/windows"
type DBCOST struct {
eKind uint32
dwUnits uint32
lValue int32
}type
DBCOST = packed record
eKind: DWORD;
dwUnits: DWORD;
lValue: Integer;
end;const DBCOST = extern struct {
eKind: u32,
dwUnits: u32,
lValue: i32,
};type
DBCOST {.packed.} = object
eKind: uint32
dwUnits: uint32
lValue: int32align(2)
struct DBCOST
{
uint eKind;
uint dwUnits;
int lValue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DBCOST サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; eKind : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwUnits : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lValue : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DBCOST, pack=2
#field int eKind
#field int dwUnits
#field int lValue
#endstruct
stdim st, DBCOST ; NSTRUCT 変数を確保
st->eKind = 100
mes "eKind=" + st->eKind