ホーム › Storage.Xps › StartDocA
StartDocA
関数印刷ジョブを開始する(ANSI版)。指定デバイスコンテキストで新しいドキュメントを開始する。
シグネチャ
// GDI32.dll (ANSI / -A)
#include <windows.h>
INT StartDocA(
HDC hdc,
const DOCINFOA* lpdi
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hdc | HDC | in |
| lpdi | DOCINFOA* | in |
戻り値の型: INT
各言語での呼び出し定義
// GDI32.dll (ANSI / -A)
#include <windows.h>
INT StartDocA(
HDC hdc,
const DOCINFOA* lpdi
);[DllImport("GDI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int StartDocA(
IntPtr hdc, // HDC
IntPtr lpdi // DOCINFOA*
);<DllImport("GDI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function StartDocA(
hdc As IntPtr, ' HDC
lpdi As IntPtr ' DOCINFOA*
) As Integer
End Function' hdc : HDC
' lpdi : DOCINFOA*
Declare PtrSafe Function StartDocA Lib "gdi32" ( _
ByVal hdc As LongPtr, _
ByVal lpdi As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
StartDocA = ctypes.windll.gdi32.StartDocA
StartDocA.restype = ctypes.c_int
StartDocA.argtypes = [
wintypes.HANDLE, # hdc : HDC
ctypes.c_void_p, # lpdi : DOCINFOA*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
StartDocA = Fiddle::Function.new(
lib['StartDocA'],
[
Fiddle::TYPE_VOIDP, # hdc : HDC
Fiddle::TYPE_VOIDP, # lpdi : DOCINFOA*
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn StartDocA(
hdc: *mut core::ffi::c_void, // HDC
lpdi: *const DOCINFOA // DOCINFOA*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("GDI32.dll", CharSet = CharSet.Ansi)]
public static extern int StartDocA(IntPtr hdc, IntPtr lpdi);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_StartDocA' -Namespace Win32 -PassThru
# $api::StartDocA(hdc, lpdi)#uselib "GDI32.dll"
#func global StartDocA "StartDocA" sptr, sptr
; StartDocA hdc, varptr(lpdi) ; 戻り値は stat
; hdc : HDC -> "sptr"
; lpdi : DOCINFOA* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "GDI32.dll" #cfunc global StartDocA "StartDocA" sptr, var ; res = StartDocA(hdc, lpdi) ; hdc : HDC -> "sptr" ; lpdi : DOCINFOA* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "GDI32.dll" #cfunc global StartDocA "StartDocA" sptr, sptr ; res = StartDocA(hdc, varptr(lpdi)) ; hdc : HDC -> "sptr" ; lpdi : DOCINFOA* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT StartDocA(HDC hdc, DOCINFOA* lpdi) #uselib "GDI32.dll" #cfunc global StartDocA "StartDocA" intptr, var ; res = StartDocA(hdc, lpdi) ; hdc : HDC -> "intptr" ; lpdi : DOCINFOA* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT StartDocA(HDC hdc, DOCINFOA* lpdi) #uselib "GDI32.dll" #cfunc global StartDocA "StartDocA" intptr, intptr ; res = StartDocA(hdc, varptr(lpdi)) ; hdc : HDC -> "intptr" ; lpdi : DOCINFOA* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procStartDocA = gdi32.NewProc("StartDocA")
)
// hdc (HDC), lpdi (DOCINFOA*)
r1, _, err := procStartDocA.Call(
uintptr(hdc),
uintptr(lpdi),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction StartDocA(
hdc: THandle; // HDC
lpdi: Pointer // DOCINFOA*
): Integer; stdcall;
external 'GDI32.dll' name 'StartDocA';result := DllCall("GDI32\StartDocA"
, "Ptr", hdc ; HDC
, "Ptr", lpdi ; DOCINFOA*
, "Int") ; return: INT●StartDocA(hdc, lpdi) = DLL("GDI32.dll", "int StartDocA(void*, void*)")
# 呼び出し: StartDocA(hdc, lpdi)
# hdc : HDC -> "void*"
# lpdi : DOCINFOA* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。