ホーム › UI.Controls › DPA_CreateEx
DPA_CreateEx
関数ヒープを指定して動的ポインタ配列を作成する。
シグネチャ
// COMCTL32.dll
#include <windows.h>
HDPA DPA_CreateEx(
INT cpGrow,
HANDLE hheap // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| cpGrow | INT | in |
| hheap | HANDLE | inoptional |
戻り値の型: HDPA
各言語での呼び出し定義
// COMCTL32.dll
#include <windows.h>
HDPA DPA_CreateEx(
INT cpGrow,
HANDLE hheap // optional
);[DllImport("COMCTL32.dll", ExactSpelling = true)]
static extern IntPtr DPA_CreateEx(
int cpGrow, // INT
IntPtr hheap // HANDLE optional
);<DllImport("COMCTL32.dll", ExactSpelling:=True)>
Public Shared Function DPA_CreateEx(
cpGrow As Integer, ' INT
hheap As IntPtr ' HANDLE optional
) As IntPtr
End Function' cpGrow : INT
' hheap : HANDLE optional
Declare PtrSafe Function DPA_CreateEx Lib "comctl32" ( _
ByVal cpGrow As Long, _
ByVal hheap As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DPA_CreateEx = ctypes.windll.comctl32.DPA_CreateEx
DPA_CreateEx.restype = ctypes.c_ssize_t
DPA_CreateEx.argtypes = [
ctypes.c_int, # cpGrow : INT
wintypes.HANDLE, # hheap : HANDLE optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('COMCTL32.dll')
DPA_CreateEx = Fiddle::Function.new(
lib['DPA_CreateEx'],
[
Fiddle::TYPE_INT, # cpGrow : INT
Fiddle::TYPE_VOIDP, # hheap : HANDLE optional
],
Fiddle::TYPE_INTPTR_T)#[link(name = "comctl32")]
extern "system" {
fn DPA_CreateEx(
cpGrow: i32, // INT
hheap: *mut core::ffi::c_void // HANDLE optional
) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("COMCTL32.dll")]
public static extern IntPtr DPA_CreateEx(int cpGrow, IntPtr hheap);
"@
$api = Add-Type -MemberDefinition $sig -Name 'COMCTL32_DPA_CreateEx' -Namespace Win32 -PassThru
# $api::DPA_CreateEx(cpGrow, hheap)#uselib "COMCTL32.dll"
#func global DPA_CreateEx "DPA_CreateEx" sptr, sptr
; DPA_CreateEx cpGrow, hheap ; 戻り値は stat
; cpGrow : INT -> "sptr"
; hheap : HANDLE optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "COMCTL32.dll"
#cfunc global DPA_CreateEx "DPA_CreateEx" int, sptr
; res = DPA_CreateEx(cpGrow, hheap)
; cpGrow : INT -> "int"
; hheap : HANDLE optional -> "sptr"; HDPA DPA_CreateEx(INT cpGrow, HANDLE hheap)
#uselib "COMCTL32.dll"
#cfunc global DPA_CreateEx "DPA_CreateEx" int, intptr
; res = DPA_CreateEx(cpGrow, hheap)
; cpGrow : INT -> "int"
; hheap : HANDLE optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
procDPA_CreateEx = comctl32.NewProc("DPA_CreateEx")
)
// cpGrow (INT), hheap (HANDLE optional)
r1, _, err := procDPA_CreateEx.Call(
uintptr(cpGrow),
uintptr(hheap),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HDPAfunction DPA_CreateEx(
cpGrow: Integer; // INT
hheap: THandle // HANDLE optional
): NativeInt; stdcall;
external 'COMCTL32.dll' name 'DPA_CreateEx';result := DllCall("COMCTL32\DPA_CreateEx"
, "Int", cpGrow ; INT
, "Ptr", hheap ; HANDLE optional
, "Ptr") ; return: HDPA●DPA_CreateEx(cpGrow, hheap) = DLL("COMCTL32.dll", "int DPA_CreateEx(int, void*)")
# 呼び出し: DPA_CreateEx(cpGrow, hheap)
# cpGrow : INT -> "int"
# hheap : HANDLE optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。