Win32 API 日本語リファレンス
ホームSystem.AddressBook › BuildDisplayTable

BuildDisplayTable

関数
プロパティページ用の表示テーブルを構築する。
DLLMAPI32.dll呼出規約winapi

シグネチャ

// MAPI32.dll
#include <windows.h>

HRESULT BuildDisplayTable(
    LPALLOCATEBUFFER lpAllocateBuffer,
    LPALLOCATEMORE lpAllocateMore,
    LPFREEBUFFER lpFreeBuffer,
    IMalloc* lpMalloc,
    HINSTANCE hInstance,
    DWORD cPages,
    DTPAGE* lpPage,
    DWORD ulFlags,
    IMAPITable** lppTable,
    ITableData** lppTblData
);

パラメーター

名前方向
lpAllocateBufferLPALLOCATEBUFFERin
lpAllocateMoreLPALLOCATEMOREin
lpFreeBufferLPFREEBUFFERin
lpMallocIMalloc*in
hInstanceHINSTANCEin
cPagesDWORDin
lpPageDTPAGE*inout
ulFlagsDWORDin
lppTableIMAPITable**out
lppTblDataITableData**out

戻り値の型: HRESULT

各言語での呼び出し定義

// MAPI32.dll
#include <windows.h>

HRESULT BuildDisplayTable(
    LPALLOCATEBUFFER lpAllocateBuffer,
    LPALLOCATEMORE lpAllocateMore,
    LPFREEBUFFER lpFreeBuffer,
    IMalloc* lpMalloc,
    HINSTANCE hInstance,
    DWORD cPages,
    DTPAGE* lpPage,
    DWORD ulFlags,
    IMAPITable** lppTable,
    ITableData** lppTblData
);
[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern int BuildDisplayTable(
    IntPtr lpAllocateBuffer,   // LPALLOCATEBUFFER
    IntPtr lpAllocateMore,   // LPALLOCATEMORE
    IntPtr lpFreeBuffer,   // LPFREEBUFFER
    IntPtr lpMalloc,   // IMalloc*
    IntPtr hInstance,   // HINSTANCE
    uint cPages,   // DWORD
    IntPtr lpPage,   // DTPAGE* in/out
    uint ulFlags,   // DWORD
    IntPtr lppTable,   // IMAPITable** out
    IntPtr lppTblData   // ITableData** out
);
<DllImport("MAPI32.dll", ExactSpelling:=True)>
Public Shared Function BuildDisplayTable(
    lpAllocateBuffer As IntPtr,   ' LPALLOCATEBUFFER
    lpAllocateMore As IntPtr,   ' LPALLOCATEMORE
    lpFreeBuffer As IntPtr,   ' LPFREEBUFFER
    lpMalloc As IntPtr,   ' IMalloc*
    hInstance As IntPtr,   ' HINSTANCE
    cPages As UInteger,   ' DWORD
    lpPage As IntPtr,   ' DTPAGE* in/out
    ulFlags As UInteger,   ' DWORD
    lppTable As IntPtr,   ' IMAPITable** out
    lppTblData As IntPtr   ' ITableData** out
) As Integer
End Function
' lpAllocateBuffer : LPALLOCATEBUFFER
' lpAllocateMore : LPALLOCATEMORE
' lpFreeBuffer : LPFREEBUFFER
' lpMalloc : IMalloc*
' hInstance : HINSTANCE
' cPages : DWORD
' lpPage : DTPAGE* in/out
' ulFlags : DWORD
' lppTable : IMAPITable** out
' lppTblData : ITableData** out
Declare PtrSafe Function BuildDisplayTable Lib "mapi32" ( _
    ByVal lpAllocateBuffer As LongPtr, _
    ByVal lpAllocateMore As LongPtr, _
    ByVal lpFreeBuffer As LongPtr, _
    ByVal lpMalloc As LongPtr, _
    ByVal hInstance As LongPtr, _
    ByVal cPages As Long, _
    ByVal lpPage As LongPtr, _
    ByVal ulFlags As Long, _
    ByVal lppTable As LongPtr, _
    ByVal lppTblData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

BuildDisplayTable = ctypes.windll.mapi32.BuildDisplayTable
BuildDisplayTable.restype = ctypes.c_int
BuildDisplayTable.argtypes = [
    ctypes.c_void_p,  # lpAllocateBuffer : LPALLOCATEBUFFER
    ctypes.c_void_p,  # lpAllocateMore : LPALLOCATEMORE
    ctypes.c_void_p,  # lpFreeBuffer : LPFREEBUFFER
    ctypes.c_void_p,  # lpMalloc : IMalloc*
    wintypes.HANDLE,  # hInstance : HINSTANCE
    wintypes.DWORD,  # cPages : DWORD
    ctypes.c_void_p,  # lpPage : DTPAGE* in/out
    wintypes.DWORD,  # ulFlags : DWORD
    ctypes.c_void_p,  # lppTable : IMAPITable** out
    ctypes.c_void_p,  # lppTblData : ITableData** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MAPI32.dll')
BuildDisplayTable = Fiddle::Function.new(
  lib['BuildDisplayTable'],
  [
    Fiddle::TYPE_VOIDP,  # lpAllocateBuffer : LPALLOCATEBUFFER
    Fiddle::TYPE_VOIDP,  # lpAllocateMore : LPALLOCATEMORE
    Fiddle::TYPE_VOIDP,  # lpFreeBuffer : LPFREEBUFFER
    Fiddle::TYPE_VOIDP,  # lpMalloc : IMalloc*
    Fiddle::TYPE_VOIDP,  # hInstance : HINSTANCE
    -Fiddle::TYPE_INT,  # cPages : DWORD
    Fiddle::TYPE_VOIDP,  # lpPage : DTPAGE* in/out
    -Fiddle::TYPE_INT,  # ulFlags : DWORD
    Fiddle::TYPE_VOIDP,  # lppTable : IMAPITable** out
    Fiddle::TYPE_VOIDP,  # lppTblData : ITableData** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mapi32")]
extern "system" {
    fn BuildDisplayTable(
        lpAllocateBuffer: *const core::ffi::c_void,  // LPALLOCATEBUFFER
        lpAllocateMore: *const core::ffi::c_void,  // LPALLOCATEMORE
        lpFreeBuffer: *const core::ffi::c_void,  // LPFREEBUFFER
        lpMalloc: *mut core::ffi::c_void,  // IMalloc*
        hInstance: *mut core::ffi::c_void,  // HINSTANCE
        cPages: u32,  // DWORD
        lpPage: *mut DTPAGE,  // DTPAGE* in/out
        ulFlags: u32,  // DWORD
        lppTable: *mut *mut core::ffi::c_void,  // IMAPITable** out
        lppTblData: *mut *mut core::ffi::c_void  // ITableData** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MAPI32.dll")]
public static extern int BuildDisplayTable(IntPtr lpAllocateBuffer, IntPtr lpAllocateMore, IntPtr lpFreeBuffer, IntPtr lpMalloc, IntPtr hInstance, uint cPages, IntPtr lpPage, uint ulFlags, IntPtr lppTable, IntPtr lppTblData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_BuildDisplayTable' -Namespace Win32 -PassThru
# $api::BuildDisplayTable(lpAllocateBuffer, lpAllocateMore, lpFreeBuffer, lpMalloc, hInstance, cPages, lpPage, ulFlags, lppTable, lppTblData)
#uselib "MAPI32.dll"
#func global BuildDisplayTable "BuildDisplayTable" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; BuildDisplayTable lpAllocateBuffer, lpAllocateMore, lpFreeBuffer, lpMalloc, hInstance, cPages, varptr(lpPage), ulFlags, lppTable, lppTblData   ; 戻り値は stat
; lpAllocateBuffer : LPALLOCATEBUFFER -> "sptr"
; lpAllocateMore : LPALLOCATEMORE -> "sptr"
; lpFreeBuffer : LPFREEBUFFER -> "sptr"
; lpMalloc : IMalloc* -> "sptr"
; hInstance : HINSTANCE -> "sptr"
; cPages : DWORD -> "sptr"
; lpPage : DTPAGE* in/out -> "sptr"
; ulFlags : DWORD -> "sptr"
; lppTable : IMAPITable** out -> "sptr"
; lppTblData : ITableData** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MAPI32.dll"
#cfunc global BuildDisplayTable "BuildDisplayTable" sptr, sptr, sptr, sptr, sptr, int, var, int, sptr, sptr
; res = BuildDisplayTable(lpAllocateBuffer, lpAllocateMore, lpFreeBuffer, lpMalloc, hInstance, cPages, lpPage, ulFlags, lppTable, lppTblData)
; lpAllocateBuffer : LPALLOCATEBUFFER -> "sptr"
; lpAllocateMore : LPALLOCATEMORE -> "sptr"
; lpFreeBuffer : LPFREEBUFFER -> "sptr"
; lpMalloc : IMalloc* -> "sptr"
; hInstance : HINSTANCE -> "sptr"
; cPages : DWORD -> "int"
; lpPage : DTPAGE* in/out -> "var"
; ulFlags : DWORD -> "int"
; lppTable : IMAPITable** out -> "sptr"
; lppTblData : ITableData** out -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT BuildDisplayTable(LPALLOCATEBUFFER lpAllocateBuffer, LPALLOCATEMORE lpAllocateMore, LPFREEBUFFER lpFreeBuffer, IMalloc* lpMalloc, HINSTANCE hInstance, DWORD cPages, DTPAGE* lpPage, DWORD ulFlags, IMAPITable** lppTable, ITableData** lppTblData)
#uselib "MAPI32.dll"
#cfunc global BuildDisplayTable "BuildDisplayTable" intptr, intptr, intptr, intptr, intptr, int, var, int, intptr, intptr
; res = BuildDisplayTable(lpAllocateBuffer, lpAllocateMore, lpFreeBuffer, lpMalloc, hInstance, cPages, lpPage, ulFlags, lppTable, lppTblData)
; lpAllocateBuffer : LPALLOCATEBUFFER -> "intptr"
; lpAllocateMore : LPALLOCATEMORE -> "intptr"
; lpFreeBuffer : LPFREEBUFFER -> "intptr"
; lpMalloc : IMalloc* -> "intptr"
; hInstance : HINSTANCE -> "intptr"
; cPages : DWORD -> "int"
; lpPage : DTPAGE* in/out -> "var"
; ulFlags : DWORD -> "int"
; lppTable : IMAPITable** out -> "intptr"
; lppTblData : ITableData** out -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
	procBuildDisplayTable = mapi32.NewProc("BuildDisplayTable")
)

// lpAllocateBuffer (LPALLOCATEBUFFER), lpAllocateMore (LPALLOCATEMORE), lpFreeBuffer (LPFREEBUFFER), lpMalloc (IMalloc*), hInstance (HINSTANCE), cPages (DWORD), lpPage (DTPAGE* in/out), ulFlags (DWORD), lppTable (IMAPITable** out), lppTblData (ITableData** out)
r1, _, err := procBuildDisplayTable.Call(
	uintptr(lpAllocateBuffer),
	uintptr(lpAllocateMore),
	uintptr(lpFreeBuffer),
	uintptr(lpMalloc),
	uintptr(hInstance),
	uintptr(cPages),
	uintptr(lpPage),
	uintptr(ulFlags),
	uintptr(lppTable),
	uintptr(lppTblData),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function BuildDisplayTable(
  lpAllocateBuffer: Pointer;   // LPALLOCATEBUFFER
  lpAllocateMore: Pointer;   // LPALLOCATEMORE
  lpFreeBuffer: Pointer;   // LPFREEBUFFER
  lpMalloc: Pointer;   // IMalloc*
  hInstance: THandle;   // HINSTANCE
  cPages: DWORD;   // DWORD
  lpPage: Pointer;   // DTPAGE* in/out
  ulFlags: DWORD;   // DWORD
  lppTable: Pointer;   // IMAPITable** out
  lppTblData: Pointer   // ITableData** out
): Integer; stdcall;
  external 'MAPI32.dll' name 'BuildDisplayTable';
result := DllCall("MAPI32\BuildDisplayTable"
    , "Ptr", lpAllocateBuffer   ; LPALLOCATEBUFFER
    , "Ptr", lpAllocateMore   ; LPALLOCATEMORE
    , "Ptr", lpFreeBuffer   ; LPFREEBUFFER
    , "Ptr", lpMalloc   ; IMalloc*
    , "Ptr", hInstance   ; HINSTANCE
    , "UInt", cPages   ; DWORD
    , "Ptr", lpPage   ; DTPAGE* in/out
    , "UInt", ulFlags   ; DWORD
    , "Ptr", lppTable   ; IMAPITable** out
    , "Ptr", lppTblData   ; ITableData** out
    , "Int")   ; return: HRESULT
●BuildDisplayTable(lpAllocateBuffer, lpAllocateMore, lpFreeBuffer, lpMalloc, hInstance, cPages, lpPage, ulFlags, lppTable, lppTblData) = DLL("MAPI32.dll", "int BuildDisplayTable(void*, void*, void*, void*, void*, dword, void*, dword, void*, void*)")
# 呼び出し: BuildDisplayTable(lpAllocateBuffer, lpAllocateMore, lpFreeBuffer, lpMalloc, hInstance, cPages, lpPage, ulFlags, lppTable, lppTblData)
# lpAllocateBuffer : LPALLOCATEBUFFER -> "void*"
# lpAllocateMore : LPALLOCATEMORE -> "void*"
# lpFreeBuffer : LPFREEBUFFER -> "void*"
# lpMalloc : IMalloc* -> "void*"
# hInstance : HINSTANCE -> "void*"
# cPages : DWORD -> "dword"
# lpPage : DTPAGE* in/out -> "void*"
# ulFlags : DWORD -> "dword"
# lppTable : IMAPITable** out -> "void*"
# lppTblData : ITableData** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。