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

DPA_Create

関数
動的ポインタ配列を作成する。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HDPA DPA_Create(
    INT cItemGrow
);

パラメーター

名前方向
cItemGrowINTin

戻り値の型: HDPA

各言語での呼び出し定義

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

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

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

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

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procDPA_Create = comctl32.NewProc("DPA_Create")
)

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