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

JetCreateTableColumnIndex4A

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

シグネチャ

// ESENT.dll  (ANSI / -A)
#include <windows.h>

INT JetCreateTableColumnIndex4A(
    JET_SESID sesid,
    DWORD dbid,
    JET_TABLECREATE4_A* ptablecreate
);

パラメーター

名前方向
sesidJET_SESIDin
dbidDWORDin
ptablecreateJET_TABLECREATE4_A*inout

戻り値の型: INT

各言語での呼び出し定義

// ESENT.dll  (ANSI / -A)
#include <windows.h>

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

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

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

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetCreateTableColumnIndex4A = esent.NewProc("JetCreateTableColumnIndex4A")
)

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