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

bcp_exec

関数
ファイルとテーブル間の一括コピーを実行する。
DLLodbcbcp.dll呼出規約winapi

シグネチャ

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

SHORT bcp_exec(
    void* param0,
    INT* param1
);

パラメーター

名前方向
param0void*inout
param1INT*inout

戻り値の型: SHORT

各言語での呼び出し定義

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

SHORT bcp_exec(
    void* param0,
    INT* param1
);
[DllImport("odbcbcp.dll", ExactSpelling = true)]
static extern short bcp_exec(
    IntPtr param0,   // void* in/out
    ref int param1   // INT* in/out
);
<DllImport("odbcbcp.dll", ExactSpelling:=True)>
Public Shared Function bcp_exec(
    param0 As IntPtr,   ' void* in/out
    ByRef param1 As Integer   ' INT* in/out
) As Short
End Function
' param0 : void* in/out
' param1 : INT* in/out
Declare PtrSafe Function bcp_exec Lib "odbcbcp" ( _
    ByVal param0 As LongPtr, _
    ByRef param1 As Long) As Integer
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

bcp_exec = ctypes.windll.odbcbcp.bcp_exec
bcp_exec.restype = ctypes.c_short
bcp_exec.argtypes = [
    ctypes.POINTER(None),  # param0 : void* in/out
    ctypes.POINTER(ctypes.c_int),  # param1 : INT* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	odbcbcp = windows.NewLazySystemDLL("odbcbcp.dll")
	procbcp_exec = odbcbcp.NewProc("bcp_exec")
)

// param0 (void* in/out), param1 (INT* in/out)
r1, _, err := procbcp_exec.Call(
	uintptr(param0),
	uintptr(param1),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // SHORT
function bcp_exec(
  param0: Pointer;   // void* in/out
  param1: Pointer   // INT* in/out
): Smallint; stdcall;
  external 'odbcbcp.dll' name 'bcp_exec';
result := DllCall("odbcbcp\bcp_exec"
    , "Ptr", param0   ; void* in/out
    , "Ptr", param1   ; INT* in/out
    , "Short")   ; return: SHORT
●bcp_exec(param0, param1) = DLL("odbcbcp.dll", "int bcp_exec(void*, void*)")
# 呼び出し: bcp_exec(param0, param1)
# param0 : void* in/out -> "void*"
# param1 : INT* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。