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

ODBCSetTryWaitValue

関数
接続プールの再試行待機時間の値を設定する。
DLLODBC32.dll呼出規約winapi

シグネチャ

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

BOOL ODBCSetTryWaitValue(
    DWORD dwValue
);

パラメーター

名前方向
dwValueDWORDin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL ODBCSetTryWaitValue(
    DWORD dwValue
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ODBC32.dll", ExactSpelling = true)]
static extern bool ODBCSetTryWaitValue(
    uint dwValue   // DWORD
);
<DllImport("ODBC32.dll", ExactSpelling:=True)>
Public Shared Function ODBCSetTryWaitValue(
    dwValue As UInteger   ' DWORD
) As Boolean
End Function
' dwValue : DWORD
Declare PtrSafe Function ODBCSetTryWaitValue Lib "odbc32" ( _
    ByVal dwValue As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ODBCSetTryWaitValue = ctypes.windll.odbc32.ODBCSetTryWaitValue
ODBCSetTryWaitValue.restype = wintypes.BOOL
ODBCSetTryWaitValue.argtypes = [
    wintypes.DWORD,  # dwValue : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ODBC32.dll')
ODBCSetTryWaitValue = Fiddle::Function.new(
  lib['ODBCSetTryWaitValue'],
  [
    -Fiddle::TYPE_INT,  # dwValue : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "odbc32")]
extern "system" {
    fn ODBCSetTryWaitValue(
        dwValue: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ODBC32.dll")]
public static extern bool ODBCSetTryWaitValue(uint dwValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ODBC32_ODBCSetTryWaitValue' -Namespace Win32 -PassThru
# $api::ODBCSetTryWaitValue(dwValue)
#uselib "ODBC32.dll"
#func global ODBCSetTryWaitValue "ODBCSetTryWaitValue" sptr
; ODBCSetTryWaitValue dwValue   ; 戻り値は stat
; dwValue : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ODBC32.dll"
#cfunc global ODBCSetTryWaitValue "ODBCSetTryWaitValue" int
; res = ODBCSetTryWaitValue(dwValue)
; dwValue : DWORD -> "int"
; BOOL ODBCSetTryWaitValue(DWORD dwValue)
#uselib "ODBC32.dll"
#cfunc global ODBCSetTryWaitValue "ODBCSetTryWaitValue" int
; res = ODBCSetTryWaitValue(dwValue)
; dwValue : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	odbc32 = windows.NewLazySystemDLL("ODBC32.dll")
	procODBCSetTryWaitValue = odbc32.NewProc("ODBCSetTryWaitValue")
)

// dwValue (DWORD)
r1, _, err := procODBCSetTryWaitValue.Call(
	uintptr(dwValue),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function ODBCSetTryWaitValue(
  dwValue: DWORD   // DWORD
): BOOL; stdcall;
  external 'ODBC32.dll' name 'ODBCSetTryWaitValue';
result := DllCall("ODBC32\ODBCSetTryWaitValue"
    , "UInt", dwValue   ; DWORD
    , "Int")   ; return: BOOL
●ODBCSetTryWaitValue(dwValue) = DLL("ODBC32.dll", "bool ODBCSetTryWaitValue(dword)")
# 呼び出し: ODBCSetTryWaitValue(dwValue)
# dwValue : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。