ホーム › Globalization › MAPPING_DATA_RANGE
MAPPING_DATA_RANGE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwStartIndex | DWORD | 4 | +0 | +0 | テキスト内におけるサブ範囲の開始位置のインデックスです。0 は、関数の dwIndex パラメーターに渡されたインデックスからのオフセットではなく、MappingRecognizeText に渡されたポインターが指す文字を示します。この値はテキスト全体の長さより小さい必要があります。 |
| dwEndIndex | DWORD | 4 | +4 | +4 | テキスト内におけるサブ範囲の終了位置のインデックスです。0 は、関数の dwIndex パラメーターに渡されたインデックスからのオフセットではなく、MappingRecognizeText に渡されたポインターが指す文字を示します。この値はテキスト全体の長さより小さい必要があります。 |
| pszDescription | LPWSTR | 8/4 | +8 | +8 | 予約済みです。 |
| dwDescriptionLength | DWORD | 4 | +16 | +12 | 予約済みです。 |
| pData | void* | 8/4 | +24 | +16 | サブ範囲に関連付けられたサービスの出力として取得されるデータへのポインターです。このデータは、pszContentType メンバーで指定されたコンテンツ タイプが示す形式でなければなりません。 |
| dwDataSize | DWORD | 4 | +32 | +20 | pData で指定されたデータのサイズ (バイト単位) です。各サービスは、出力データのサイズをバイト単位で報告する必要があります。 |
| pszContentType | LPWSTR | 8/4 | +40 | +24 | 省略可能です。pData が示すデータの MIME コンテンツ タイプを指定する文字列へのポインターです。コンテンツ タイプの例としては、"text/plain"、"text/html"、"text/css" などがあります。 メモ Windows 7 では、ELS サービスはコンテンツ タイプ "text/plain" のみをサポートします。コンテンツ タイプの仕様については、Text Media Types を参照してください。
|
| prgActionIds | LPWSTR* | 8/4 | +48 | +28 | このサブ範囲で使用可能なアクション ID です。MappingDoAction の呼び出しに使用できます。 メモ Windows 7 では、ELS サービスはアクションを公開しません。
|
| dwActionsCount | DWORD | 4 | +56 | +32 | このサブ範囲で使用可能なアクションの数です。 メモ Windows 7 では、ELS サービスはアクションを公開しません。
|
| prgActionDisplayNames | LPWSTR* | 8/4 | +64 | +36 | このサブ範囲に対するアクションの表示名です。これらの文字列はローカライズできます。 メモ Windows 7 では、ELS サービスはアクションを公開しません。
|
公式ドキュメント
認識されたテキストのサブ範囲に対するテキスト認識結果を格納します。この型の構造体の配列は、Extended Linguistic Services (ELS) サービスによって MAPPING_PROPERTY_BAG 構造体内に取得されます。
解説(Remarks)
メモ アプリケーションは、このデータ構造体のメンバーをいずれも変更しないでください。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// MAPPING_DATA_RANGE (x64 72 / x86 40 バイト)
typedef struct MAPPING_DATA_RANGE {
DWORD dwStartIndex;
DWORD dwEndIndex;
LPWSTR pszDescription;
DWORD dwDescriptionLength;
void* pData;
DWORD dwDataSize;
LPWSTR pszContentType;
LPWSTR* prgActionIds;
DWORD dwActionsCount;
LPWSTR* prgActionDisplayNames;
} MAPPING_DATA_RANGE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MAPPING_DATA_RANGE
{
public uint dwStartIndex;
public uint dwEndIndex;
public IntPtr pszDescription;
public uint dwDescriptionLength;
public IntPtr pData;
public uint dwDataSize;
public IntPtr pszContentType;
public IntPtr prgActionIds;
public uint dwActionsCount;
public IntPtr prgActionDisplayNames;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MAPPING_DATA_RANGE
Public dwStartIndex As UInteger
Public dwEndIndex As UInteger
Public pszDescription As IntPtr
Public dwDescriptionLength As UInteger
Public pData As IntPtr
Public dwDataSize As UInteger
Public pszContentType As IntPtr
Public prgActionIds As IntPtr
Public dwActionsCount As UInteger
Public prgActionDisplayNames As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MAPPING_DATA_RANGE(ctypes.Structure):
_fields_ = [
("dwStartIndex", wintypes.DWORD),
("dwEndIndex", wintypes.DWORD),
("pszDescription", ctypes.c_void_p),
("dwDescriptionLength", wintypes.DWORD),
("pData", ctypes.c_void_p),
("dwDataSize", wintypes.DWORD),
("pszContentType", ctypes.c_void_p),
("prgActionIds", ctypes.c_void_p),
("dwActionsCount", wintypes.DWORD),
("prgActionDisplayNames", ctypes.c_void_p),
]#[repr(C)]
pub struct MAPPING_DATA_RANGE {
pub dwStartIndex: u32,
pub dwEndIndex: u32,
pub pszDescription: *mut core::ffi::c_void,
pub dwDescriptionLength: u32,
pub pData: *mut core::ffi::c_void,
pub dwDataSize: u32,
pub pszContentType: *mut core::ffi::c_void,
pub prgActionIds: *mut core::ffi::c_void,
pub dwActionsCount: u32,
pub prgActionDisplayNames: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type MAPPING_DATA_RANGE struct {
dwStartIndex uint32
dwEndIndex uint32
pszDescription uintptr
dwDescriptionLength uint32
pData uintptr
dwDataSize uint32
pszContentType uintptr
prgActionIds uintptr
dwActionsCount uint32
prgActionDisplayNames uintptr
}type
MAPPING_DATA_RANGE = record
dwStartIndex: DWORD;
dwEndIndex: DWORD;
pszDescription: Pointer;
dwDescriptionLength: DWORD;
pData: Pointer;
dwDataSize: DWORD;
pszContentType: Pointer;
prgActionIds: Pointer;
dwActionsCount: DWORD;
prgActionDisplayNames: Pointer;
end;const MAPPING_DATA_RANGE = extern struct {
dwStartIndex: u32,
dwEndIndex: u32,
pszDescription: ?*anyopaque,
dwDescriptionLength: u32,
pData: ?*anyopaque,
dwDataSize: u32,
pszContentType: ?*anyopaque,
prgActionIds: ?*anyopaque,
dwActionsCount: u32,
prgActionDisplayNames: ?*anyopaque,
};type
MAPPING_DATA_RANGE {.bycopy.} = object
dwStartIndex: uint32
dwEndIndex: uint32
pszDescription: pointer
dwDescriptionLength: uint32
pData: pointer
dwDataSize: uint32
pszContentType: pointer
prgActionIds: pointer
dwActionsCount: uint32
prgActionDisplayNames: pointerstruct MAPPING_DATA_RANGE
{
uint dwStartIndex;
uint dwEndIndex;
void* pszDescription;
uint dwDescriptionLength;
void* pData;
uint dwDataSize;
void* pszContentType;
void* prgActionIds;
uint dwActionsCount;
void* prgActionDisplayNames;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MAPPING_DATA_RANGE サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwStartIndex : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwEndIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszDescription : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwDescriptionLength : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pData : void* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwDataSize : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pszContentType : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; prgActionIds : LPWSTR* (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwActionsCount : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; prgActionDisplayNames : LPWSTR* (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MAPPING_DATA_RANGE サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwStartIndex : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwEndIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszDescription : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwDescriptionLength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pData : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwDataSize : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pszContentType : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; prgActionIds : LPWSTR* (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; dwActionsCount : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; prgActionDisplayNames : LPWSTR* (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MAPPING_DATA_RANGE
#field int dwStartIndex
#field int dwEndIndex
#field intptr pszDescription
#field int dwDescriptionLength
#field intptr pData
#field int dwDataSize
#field intptr pszContentType
#field intptr prgActionIds
#field int dwActionsCount
#field intptr prgActionDisplayNames
#endstruct
stdim st, MAPPING_DATA_RANGE ; NSTRUCT 変数を確保
st->dwStartIndex = 100
mes "dwStartIndex=" + st->dwStartIndex