ホーム › System.Ole › QACONTAINER
QACONTAINER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で表す。 |
| pClientSite | IOleClientSite* | 8/4 | +8 | +4 | コントロールのクライアントサイトIOleClientSiteへのポインタである。 |
| pAdviseSink | IAdviseSinkEx* | 8/4 | +16 | +8 | 描画通知を受け取るIAdviseSinkExへのポインタである。NULL可。 |
| pPropertyNotifySink | IPropertyNotifySink* | 8/4 | +24 | +12 | プロパティ変更通知を受け取るIPropertyNotifySinkへのポインタである。NULL可。 |
| pUnkEventSink | IUnknown* | 8/4 | +32 | +16 | イベントを受け取るシンクのIUnknownへのポインタである。NULL可。 |
| dwAmbientFlags | DWORD | 4 | +40 | +20 | アンビエントプロパティの提供状況を示すフラグ(QACONTAINERFLAGS)である。 |
| colorFore | DWORD | 4 | +44 | +24 | アンビエントの前景色(OLE_COLOR)である。 |
| colorBack | DWORD | 4 | +48 | +28 | アンビエントの背景色(OLE_COLOR)である。 |
| pFont | IFont* | 8/4 | +56 | +32 | アンビエントフォントを表すIFontへのポインタである。NULL可。 |
| pUndoMgr | IOleUndoManager* | 8/4 | +64 | +36 | 元に戻す管理を行うIOleUndoManagerへのポインタである。NULL可。 |
| dwAppearance | DWORD | 4 | +72 | +40 | コントロールの外観(フラット/3D)を示す値である。 |
| lcid | INT | 4 | +76 | +44 | コンテナのロケールID(LCID)である。 |
| hpal | HPALETTE | 8/4 | +80 | +48 | コンテナのパレットハンドルである。無ければNULL。 |
| pBindHost | IBindHost* | 8/4 | +88 | +52 | URLモニカ等のバインドを担うIBindHostへのポインタである。NULL可。 |
| pOleControlSite | IOleControlSite* | 8/4 | +96 | +56 | コントロールサイトのIOleControlSiteへのポインタである。NULL可。 |
| pServiceProvider | IServiceProvider* | 8/4 | +104 | +60 | サービス取得用のIServiceProviderへのポインタである。NULL可。 |
各言語での定義
#include <windows.h>
// QACONTAINER (x64 112 / x86 64 バイト)
typedef struct QACONTAINER {
DWORD cbSize;
IOleClientSite* pClientSite;
IAdviseSinkEx* pAdviseSink;
IPropertyNotifySink* pPropertyNotifySink;
IUnknown* pUnkEventSink;
DWORD dwAmbientFlags;
DWORD colorFore;
DWORD colorBack;
IFont* pFont;
IOleUndoManager* pUndoMgr;
DWORD dwAppearance;
INT lcid;
HPALETTE hpal;
IBindHost* pBindHost;
IOleControlSite* pOleControlSite;
IServiceProvider* pServiceProvider;
} QACONTAINER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct QACONTAINER
{
public uint cbSize;
public IntPtr pClientSite;
public IntPtr pAdviseSink;
public IntPtr pPropertyNotifySink;
public IntPtr pUnkEventSink;
public uint dwAmbientFlags;
public uint colorFore;
public uint colorBack;
public IntPtr pFont;
public IntPtr pUndoMgr;
public uint dwAppearance;
public int lcid;
public IntPtr hpal;
public IntPtr pBindHost;
public IntPtr pOleControlSite;
public IntPtr pServiceProvider;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure QACONTAINER
Public cbSize As UInteger
Public pClientSite As IntPtr
Public pAdviseSink As IntPtr
Public pPropertyNotifySink As IntPtr
Public pUnkEventSink As IntPtr
Public dwAmbientFlags As UInteger
Public colorFore As UInteger
Public colorBack As UInteger
Public pFont As IntPtr
Public pUndoMgr As IntPtr
Public dwAppearance As UInteger
Public lcid As Integer
Public hpal As IntPtr
Public pBindHost As IntPtr
Public pOleControlSite As IntPtr
Public pServiceProvider As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class QACONTAINER(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("pClientSite", ctypes.c_void_p),
("pAdviseSink", ctypes.c_void_p),
("pPropertyNotifySink", ctypes.c_void_p),
("pUnkEventSink", ctypes.c_void_p),
("dwAmbientFlags", wintypes.DWORD),
("colorFore", wintypes.DWORD),
("colorBack", wintypes.DWORD),
("pFont", ctypes.c_void_p),
("pUndoMgr", ctypes.c_void_p),
("dwAppearance", wintypes.DWORD),
("lcid", ctypes.c_int),
("hpal", ctypes.c_void_p),
("pBindHost", ctypes.c_void_p),
("pOleControlSite", ctypes.c_void_p),
("pServiceProvider", ctypes.c_void_p),
]#[repr(C)]
pub struct QACONTAINER {
pub cbSize: u32,
pub pClientSite: *mut core::ffi::c_void,
pub pAdviseSink: *mut core::ffi::c_void,
pub pPropertyNotifySink: *mut core::ffi::c_void,
pub pUnkEventSink: *mut core::ffi::c_void,
pub dwAmbientFlags: u32,
pub colorFore: u32,
pub colorBack: u32,
pub pFont: *mut core::ffi::c_void,
pub pUndoMgr: *mut core::ffi::c_void,
pub dwAppearance: u32,
pub lcid: i32,
pub hpal: *mut core::ffi::c_void,
pub pBindHost: *mut core::ffi::c_void,
pub pOleControlSite: *mut core::ffi::c_void,
pub pServiceProvider: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type QACONTAINER struct {
cbSize uint32
pClientSite uintptr
pAdviseSink uintptr
pPropertyNotifySink uintptr
pUnkEventSink uintptr
dwAmbientFlags uint32
colorFore uint32
colorBack uint32
pFont uintptr
pUndoMgr uintptr
dwAppearance uint32
lcid int32
hpal uintptr
pBindHost uintptr
pOleControlSite uintptr
pServiceProvider uintptr
}type
QACONTAINER = record
cbSize: DWORD;
pClientSite: Pointer;
pAdviseSink: Pointer;
pPropertyNotifySink: Pointer;
pUnkEventSink: Pointer;
dwAmbientFlags: DWORD;
colorFore: DWORD;
colorBack: DWORD;
pFont: Pointer;
pUndoMgr: Pointer;
dwAppearance: DWORD;
lcid: Integer;
hpal: Pointer;
pBindHost: Pointer;
pOleControlSite: Pointer;
pServiceProvider: Pointer;
end;const QACONTAINER = extern struct {
cbSize: u32,
pClientSite: ?*anyopaque,
pAdviseSink: ?*anyopaque,
pPropertyNotifySink: ?*anyopaque,
pUnkEventSink: ?*anyopaque,
dwAmbientFlags: u32,
colorFore: u32,
colorBack: u32,
pFont: ?*anyopaque,
pUndoMgr: ?*anyopaque,
dwAppearance: u32,
lcid: i32,
hpal: ?*anyopaque,
pBindHost: ?*anyopaque,
pOleControlSite: ?*anyopaque,
pServiceProvider: ?*anyopaque,
};type
QACONTAINER {.bycopy.} = object
cbSize: uint32
pClientSite: pointer
pAdviseSink: pointer
pPropertyNotifySink: pointer
pUnkEventSink: pointer
dwAmbientFlags: uint32
colorFore: uint32
colorBack: uint32
pFont: pointer
pUndoMgr: pointer
dwAppearance: uint32
lcid: int32
hpal: pointer
pBindHost: pointer
pOleControlSite: pointer
pServiceProvider: pointerstruct QACONTAINER
{
uint cbSize;
void* pClientSite;
void* pAdviseSink;
void* pPropertyNotifySink;
void* pUnkEventSink;
uint dwAmbientFlags;
uint colorFore;
uint colorBack;
void* pFont;
void* pUndoMgr;
uint dwAppearance;
int lcid;
void* hpal;
void* pBindHost;
void* pOleControlSite;
void* pServiceProvider;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; QACONTAINER サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pClientSite : IOleClientSite* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pAdviseSink : IAdviseSinkEx* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pPropertyNotifySink : IPropertyNotifySink* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pUnkEventSink : IUnknown* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwAmbientFlags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; colorFore : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; colorBack : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pFont : IFont* (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pUndoMgr : IOleUndoManager* (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwAppearance : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; lcid : INT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; hpal : HPALETTE (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; pBindHost : IBindHost* (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; pOleControlSite : IOleControlSite* (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; pServiceProvider : IServiceProvider* (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; QACONTAINER サイズ: 112 バイト(x64)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pClientSite : IOleClientSite* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pAdviseSink : IAdviseSinkEx* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pPropertyNotifySink : IPropertyNotifySink* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pUnkEventSink : IUnknown* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dwAmbientFlags : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; colorFore : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; colorBack : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; pFont : IFont* (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; pUndoMgr : IOleUndoManager* (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; dwAppearance : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; lcid : INT (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; hpal : HPALETTE (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; pBindHost : IBindHost* (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; pOleControlSite : IOleControlSite* (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; pServiceProvider : IServiceProvider* (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global QACONTAINER
#field int cbSize
#field intptr pClientSite
#field intptr pAdviseSink
#field intptr pPropertyNotifySink
#field intptr pUnkEventSink
#field int dwAmbientFlags
#field int colorFore
#field int colorBack
#field intptr pFont
#field intptr pUndoMgr
#field int dwAppearance
#field int lcid
#field intptr hpal
#field intptr pBindHost
#field intptr pOleControlSite
#field intptr pServiceProvider
#endstruct
stdim st, QACONTAINER ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize