Win32 API 日本語リファレンス
ホームStorage.Jet › JetCreateTableColumnIndex4W

JetCreateTableColumnIndex4W

関数
列とインデックスを含むESEテーブルを一括作成する(拡張版)。
DLLESENT.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// ESENT.dll  (Unicode / -W)
#include <windows.h>

INT JetCreateTableColumnIndex4W(
    JET_SESID sesid,
    DWORD dbid,
    JET_TABLECREATE4_W* ptablecreate
);

パラメーター

名前方向
sesidJET_SESIDin
dbidDWORDin
ptablecreateJET_TABLECREATE4_W*inout

戻り値の型: INT

各言語での呼び出し定義

// ESENT.dll  (Unicode / -W)
#include <windows.h>

INT JetCreateTableColumnIndex4W(
    JET_SESID sesid,
    DWORD dbid,
    JET_TABLECREATE4_W* ptablecreate
);
[DllImport("ESENT.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int JetCreateTableColumnIndex4W(
    UIntPtr sesid,   // JET_SESID
    uint dbid,   // DWORD
    IntPtr ptablecreate   // JET_TABLECREATE4_W* in/out
);
<DllImport("ESENT.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function JetCreateTableColumnIndex4W(
    sesid As UIntPtr,   ' JET_SESID
    dbid As UInteger,   ' DWORD
    ptablecreate As IntPtr   ' JET_TABLECREATE4_W* in/out
) As Integer
End Function
' sesid : JET_SESID
' dbid : DWORD
' ptablecreate : JET_TABLECREATE4_W* in/out
Declare PtrSafe Function JetCreateTableColumnIndex4W Lib "esent" ( _
    ByVal sesid As LongPtr, _
    ByVal dbid As Long, _
    ByVal ptablecreate As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JetCreateTableColumnIndex4W = ctypes.windll.esent.JetCreateTableColumnIndex4W
JetCreateTableColumnIndex4W.restype = ctypes.c_int
JetCreateTableColumnIndex4W.argtypes = [
    ctypes.c_size_t,  # sesid : JET_SESID
    wintypes.DWORD,  # dbid : DWORD
    ctypes.c_void_p,  # ptablecreate : JET_TABLECREATE4_W* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ESENT.dll')
JetCreateTableColumnIndex4W = Fiddle::Function.new(
  lib['JetCreateTableColumnIndex4W'],
  [
    Fiddle::TYPE_UINTPTR_T,  # sesid : JET_SESID
    -Fiddle::TYPE_INT,  # dbid : DWORD
    Fiddle::TYPE_VOIDP,  # ptablecreate : JET_TABLECREATE4_W* in/out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "esent")]
extern "system" {
    fn JetCreateTableColumnIndex4W(
        sesid: usize,  // JET_SESID
        dbid: u32,  // DWORD
        ptablecreate: *mut JET_TABLECREATE4_W  // JET_TABLECREATE4_W* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ESENT.dll", CharSet = CharSet.Unicode)]
public static extern int JetCreateTableColumnIndex4W(UIntPtr sesid, uint dbid, IntPtr ptablecreate);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetCreateTableColumnIndex4W' -Namespace Win32 -PassThru
# $api::JetCreateTableColumnIndex4W(sesid, dbid, ptablecreate)
#uselib "ESENT.dll"
#func global JetCreateTableColumnIndex4W "JetCreateTableColumnIndex4W" wptr, wptr, wptr
; JetCreateTableColumnIndex4W sesid, dbid, varptr(ptablecreate)   ; 戻り値は stat
; sesid : JET_SESID -> "wptr"
; dbid : DWORD -> "wptr"
; ptablecreate : JET_TABLECREATE4_W* in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ESENT.dll"
#cfunc global JetCreateTableColumnIndex4W "JetCreateTableColumnIndex4W" sptr, int, var
; res = JetCreateTableColumnIndex4W(sesid, dbid, ptablecreate)
; sesid : JET_SESID -> "sptr"
; dbid : DWORD -> "int"
; ptablecreate : JET_TABLECREATE4_W* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT JetCreateTableColumnIndex4W(JET_SESID sesid, DWORD dbid, JET_TABLECREATE4_W* ptablecreate)
#uselib "ESENT.dll"
#cfunc global JetCreateTableColumnIndex4W "JetCreateTableColumnIndex4W" intptr, int, var
; res = JetCreateTableColumnIndex4W(sesid, dbid, ptablecreate)
; sesid : JET_SESID -> "intptr"
; dbid : DWORD -> "int"
; ptablecreate : JET_TABLECREATE4_W* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetCreateTableColumnIndex4W = esent.NewProc("JetCreateTableColumnIndex4W")
)

// sesid (JET_SESID), dbid (DWORD), ptablecreate (JET_TABLECREATE4_W* in/out)
r1, _, err := procJetCreateTableColumnIndex4W.Call(
	uintptr(sesid),
	uintptr(dbid),
	uintptr(ptablecreate),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function JetCreateTableColumnIndex4W(
  sesid: NativeUInt;   // JET_SESID
  dbid: DWORD;   // DWORD
  ptablecreate: Pointer   // JET_TABLECREATE4_W* in/out
): Integer; stdcall;
  external 'ESENT.dll' name 'JetCreateTableColumnIndex4W';
result := DllCall("ESENT\JetCreateTableColumnIndex4W"
    , "UPtr", sesid   ; JET_SESID
    , "UInt", dbid   ; DWORD
    , "Ptr", ptablecreate   ; JET_TABLECREATE4_W* in/out
    , "Int")   ; return: INT
●JetCreateTableColumnIndex4W(sesid, dbid, ptablecreate) = DLL("ESENT.dll", "int JetCreateTableColumnIndex4W(int, dword, void*)")
# 呼び出し: JetCreateTableColumnIndex4W(sesid, dbid, ptablecreate)
# sesid : JET_SESID -> "int"
# dbid : DWORD -> "dword"
# ptablecreate : JET_TABLECREATE4_W* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。