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