Win32 API 日本語リファレンス
ホームUI.Controls › DSA_Create

DSA_Create

関数
動的構造体配列を作成する。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HDSA DSA_Create(
    INT cbItem,
    INT cItemGrow
);

パラメーター

名前方向
cbItemINTin
cItemGrowINTin

戻り値の型: HDSA

各言語での呼び出し定義

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

HDSA DSA_Create(
    INT cbItem,
    INT cItemGrow
);
[DllImport("COMCTL32.dll", ExactSpelling = true)]
static extern IntPtr DSA_Create(
    int cbItem,   // INT
    int cItemGrow   // INT
);
<DllImport("COMCTL32.dll", ExactSpelling:=True)>
Public Shared Function DSA_Create(
    cbItem As Integer,   ' INT
    cItemGrow As Integer   ' INT
) As IntPtr
End Function
' cbItem : INT
' cItemGrow : INT
Declare PtrSafe Function DSA_Create Lib "comctl32" ( _
    ByVal cbItem As Long, _
    ByVal cItemGrow As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DSA_Create = ctypes.windll.comctl32.DSA_Create
DSA_Create.restype = ctypes.c_ssize_t
DSA_Create.argtypes = [
    ctypes.c_int,  # cbItem : INT
    ctypes.c_int,  # cItemGrow : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('COMCTL32.dll')
DSA_Create = Fiddle::Function.new(
  lib['DSA_Create'],
  [
    Fiddle::TYPE_INT,  # cbItem : INT
    Fiddle::TYPE_INT,  # cItemGrow : INT
  ],
  Fiddle::TYPE_INTPTR_T)
#[link(name = "comctl32")]
extern "system" {
    fn DSA_Create(
        cbItem: i32,  // INT
        cItemGrow: i32  // INT
    ) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("COMCTL32.dll")]
public static extern IntPtr DSA_Create(int cbItem, int cItemGrow);
"@
$api = Add-Type -MemberDefinition $sig -Name 'COMCTL32_DSA_Create' -Namespace Win32 -PassThru
# $api::DSA_Create(cbItem, cItemGrow)
#uselib "COMCTL32.dll"
#func global DSA_Create "DSA_Create" sptr, sptr
; DSA_Create cbItem, cItemGrow   ; 戻り値は stat
; cbItem : INT -> "sptr"
; cItemGrow : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "COMCTL32.dll"
#cfunc global DSA_Create "DSA_Create" int, int
; res = DSA_Create(cbItem, cItemGrow)
; cbItem : INT -> "int"
; cItemGrow : INT -> "int"
; HDSA DSA_Create(INT cbItem, INT cItemGrow)
#uselib "COMCTL32.dll"
#cfunc global DSA_Create "DSA_Create" int, int
; res = DSA_Create(cbItem, cItemGrow)
; cbItem : INT -> "int"
; cItemGrow : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procDSA_Create = comctl32.NewProc("DSA_Create")
)

// cbItem (INT), cItemGrow (INT)
r1, _, err := procDSA_Create.Call(
	uintptr(cbItem),
	uintptr(cItemGrow),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HDSA
function DSA_Create(
  cbItem: Integer;   // INT
  cItemGrow: Integer   // INT
): NativeInt; stdcall;
  external 'COMCTL32.dll' name 'DSA_Create';
result := DllCall("COMCTL32\DSA_Create"
    , "Int", cbItem   ; INT
    , "Int", cItemGrow   ; INT
    , "Ptr")   ; return: HDSA
●DSA_Create(cbItem, cItemGrow) = DLL("COMCTL32.dll", "int DSA_Create(int, int)")
# 呼び出し: DSA_Create(cbItem, cItemGrow)
# cbItem : INT -> "int"
# cItemGrow : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。