ホーム › Storage.Jet › JetGotoBookmark
JetGotoBookmark
関数ブックマークで指定したレコードへカーソルを移動する。
シグネチャ
// ESENT.dll
#include <windows.h>
INT JetGotoBookmark(
JET_SESID sesid,
JET_TABLEID tableid,
void* pvBookmark,
DWORD cbBookmark
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| sesid | JET_SESID | in |
| tableid | JET_TABLEID | in |
| pvBookmark | void* | in |
| cbBookmark | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// ESENT.dll
#include <windows.h>
INT JetGotoBookmark(
JET_SESID sesid,
JET_TABLEID tableid,
void* pvBookmark,
DWORD cbBookmark
);[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetGotoBookmark(
UIntPtr sesid, // JET_SESID
UIntPtr tableid, // JET_TABLEID
IntPtr pvBookmark, // void*
uint cbBookmark // DWORD
);<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetGotoBookmark(
sesid As UIntPtr, ' JET_SESID
tableid As UIntPtr, ' JET_TABLEID
pvBookmark As IntPtr, ' void*
cbBookmark As UInteger ' DWORD
) As Integer
End Function' sesid : JET_SESID
' tableid : JET_TABLEID
' pvBookmark : void*
' cbBookmark : DWORD
Declare PtrSafe Function JetGotoBookmark Lib "esent" ( _
ByVal sesid As LongPtr, _
ByVal tableid As LongPtr, _
ByVal pvBookmark As LongPtr, _
ByVal cbBookmark As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JetGotoBookmark = ctypes.windll.esent.JetGotoBookmark
JetGotoBookmark.restype = ctypes.c_int
JetGotoBookmark.argtypes = [
ctypes.c_size_t, # sesid : JET_SESID
ctypes.c_size_t, # tableid : JET_TABLEID
ctypes.POINTER(None), # pvBookmark : void*
wintypes.DWORD, # cbBookmark : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ESENT.dll')
JetGotoBookmark = Fiddle::Function.new(
lib['JetGotoBookmark'],
[
Fiddle::TYPE_UINTPTR_T, # sesid : JET_SESID
Fiddle::TYPE_UINTPTR_T, # tableid : JET_TABLEID
Fiddle::TYPE_VOIDP, # pvBookmark : void*
-Fiddle::TYPE_INT, # cbBookmark : DWORD
],
Fiddle::TYPE_INT)#[link(name = "esent")]
extern "system" {
fn JetGotoBookmark(
sesid: usize, // JET_SESID
tableid: usize, // JET_TABLEID
pvBookmark: *mut (), // void*
cbBookmark: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetGotoBookmark(UIntPtr sesid, UIntPtr tableid, IntPtr pvBookmark, uint cbBookmark);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetGotoBookmark' -Namespace Win32 -PassThru
# $api::JetGotoBookmark(sesid, tableid, pvBookmark, cbBookmark)#uselib "ESENT.dll"
#func global JetGotoBookmark "JetGotoBookmark" sptr, sptr, sptr, sptr
; JetGotoBookmark sesid, tableid, pvBookmark, cbBookmark ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pvBookmark : void* -> "sptr"
; cbBookmark : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ESENT.dll"
#cfunc global JetGotoBookmark "JetGotoBookmark" sptr, sptr, sptr, int
; res = JetGotoBookmark(sesid, tableid, pvBookmark, cbBookmark)
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pvBookmark : void* -> "sptr"
; cbBookmark : DWORD -> "int"; INT JetGotoBookmark(JET_SESID sesid, JET_TABLEID tableid, void* pvBookmark, DWORD cbBookmark)
#uselib "ESENT.dll"
#cfunc global JetGotoBookmark "JetGotoBookmark" intptr, intptr, intptr, int
; res = JetGotoBookmark(sesid, tableid, pvBookmark, cbBookmark)
; sesid : JET_SESID -> "intptr"
; tableid : JET_TABLEID -> "intptr"
; pvBookmark : void* -> "intptr"
; cbBookmark : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
esent = windows.NewLazySystemDLL("ESENT.dll")
procJetGotoBookmark = esent.NewProc("JetGotoBookmark")
)
// sesid (JET_SESID), tableid (JET_TABLEID), pvBookmark (void*), cbBookmark (DWORD)
r1, _, err := procJetGotoBookmark.Call(
uintptr(sesid),
uintptr(tableid),
uintptr(pvBookmark),
uintptr(cbBookmark),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction JetGotoBookmark(
sesid: NativeUInt; // JET_SESID
tableid: NativeUInt; // JET_TABLEID
pvBookmark: Pointer; // void*
cbBookmark: DWORD // DWORD
): Integer; stdcall;
external 'ESENT.dll' name 'JetGotoBookmark';result := DllCall("ESENT\JetGotoBookmark"
, "UPtr", sesid ; JET_SESID
, "UPtr", tableid ; JET_TABLEID
, "Ptr", pvBookmark ; void*
, "UInt", cbBookmark ; DWORD
, "Int") ; return: INT●JetGotoBookmark(sesid, tableid, pvBookmark, cbBookmark) = DLL("ESENT.dll", "int JetGotoBookmark(int, int, void*, dword)")
# 呼び出し: JetGotoBookmark(sesid, tableid, pvBookmark, cbBookmark)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# pvBookmark : void* -> "void*"
# cbBookmark : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。