Win32 API 日本語リファレンス
ホームMedia.DirectShow › EALocationCodeType

EALocationCodeType

構造体
サイズx64: 8 バイト / x86: 8 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
LocationCodeSchemeLocationCodeSchemeType4+0+0地域コードの符号化方式を示す列挙値(LocationCodeSchemeType)。
state_codeBYTE1+4+4州(地域)コード。FIPS等に基づく州識別値。
county_subdivisionBYTE1+5+5郡内の細分区域コード。地域を細分化して識別する。
county_codeWORD2+6+6郡コード。地域内の郡を識別する値。

各言語での定義

#include <windows.h>

// EALocationCodeType  (x64 8 / x86 8 バイト)
typedef struct EALocationCodeType {
    LocationCodeSchemeType LocationCodeScheme;
    BYTE state_code;
    BYTE county_subdivision;
    WORD county_code;
} EALocationCodeType;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EALocationCodeType
{
    public int LocationCodeScheme;
    public byte state_code;
    public byte county_subdivision;
    public ushort county_code;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EALocationCodeType
    Public LocationCodeScheme As Integer
    Public state_code As Byte
    Public county_subdivision As Byte
    Public county_code As UShort
End Structure
import ctypes
from ctypes import wintypes

class EALocationCodeType(ctypes.Structure):
    _fields_ = [
        ("LocationCodeScheme", ctypes.c_int),
        ("state_code", ctypes.c_ubyte),
        ("county_subdivision", ctypes.c_ubyte),
        ("county_code", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct EALocationCodeType {
    pub LocationCodeScheme: i32,
    pub state_code: u8,
    pub county_subdivision: u8,
    pub county_code: u16,
}
import "golang.org/x/sys/windows"

type EALocationCodeType struct {
	LocationCodeScheme int32
	state_code byte
	county_subdivision byte
	county_code uint16
}
type
  EALocationCodeType = record
    LocationCodeScheme: Integer;
    state_code: Byte;
    county_subdivision: Byte;
    county_code: Word;
  end;
const EALocationCodeType = extern struct {
    LocationCodeScheme: i32,
    state_code: u8,
    county_subdivision: u8,
    county_code: u16,
};
type
  EALocationCodeType {.bycopy.} = object
    LocationCodeScheme: int32
    state_code: uint8
    county_subdivision: uint8
    county_code: uint16
struct EALocationCodeType
{
    int LocationCodeScheme;
    ubyte state_code;
    ubyte county_subdivision;
    ushort county_code;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EALocationCodeType サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; LocationCodeScheme : LocationCodeSchemeType (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; state_code : BYTE (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; county_subdivision : BYTE (+5, 1byte)  poke st,5,値  /  値 = peek(st,5)
; county_code : WORD (+6, 2byte)  wpoke st,6,値  /  値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EALocationCodeType
    #field int LocationCodeScheme
    #field byte state_code
    #field byte county_subdivision
    #field short county_code
#endstruct

stdim st, EALocationCodeType        ; NSTRUCT 変数を確保
st->LocationCodeScheme = 100
mes "LocationCodeScheme=" + st->LocationCodeScheme