ホーム › System.WindowsProgramming › FileSaveMarkNotExistA
FileSaveMarkNotExistA
関数存在しないファイルとしてバックアップに記録する(ANSI版)。
シグネチャ
// ADVPACK.dll (ANSI / -A)
#include <windows.h>
HRESULT FileSaveMarkNotExistA(
LPCSTR lpFileList, // optional
LPCSTR lpDir, // optional
LPCSTR lpBaseName // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpFileList | LPCSTR | inoptional |
| lpDir | LPCSTR | inoptional |
| lpBaseName | LPCSTR | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// ADVPACK.dll (ANSI / -A)
#include <windows.h>
HRESULT FileSaveMarkNotExistA(
LPCSTR lpFileList, // optional
LPCSTR lpDir, // optional
LPCSTR lpBaseName // optional
);[DllImport("ADVPACK.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int FileSaveMarkNotExistA(
[MarshalAs(UnmanagedType.LPStr)] string lpFileList, // LPCSTR optional
[MarshalAs(UnmanagedType.LPStr)] string lpDir, // LPCSTR optional
[MarshalAs(UnmanagedType.LPStr)] string lpBaseName // LPCSTR optional
);<DllImport("ADVPACK.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function FileSaveMarkNotExistA(
<MarshalAs(UnmanagedType.LPStr)> lpFileList As String, ' LPCSTR optional
<MarshalAs(UnmanagedType.LPStr)> lpDir As String, ' LPCSTR optional
<MarshalAs(UnmanagedType.LPStr)> lpBaseName As String ' LPCSTR optional
) As Integer
End Function' lpFileList : LPCSTR optional
' lpDir : LPCSTR optional
' lpBaseName : LPCSTR optional
Declare PtrSafe Function FileSaveMarkNotExistA Lib "advpack" ( _
ByVal lpFileList As String, _
ByVal lpDir As String, _
ByVal lpBaseName As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
FileSaveMarkNotExistA = ctypes.windll.advpack.FileSaveMarkNotExistA
FileSaveMarkNotExistA.restype = ctypes.c_int
FileSaveMarkNotExistA.argtypes = [
wintypes.LPCSTR, # lpFileList : LPCSTR optional
wintypes.LPCSTR, # lpDir : LPCSTR optional
wintypes.LPCSTR, # lpBaseName : LPCSTR optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ADVPACK.dll')
FileSaveMarkNotExistA = Fiddle::Function.new(
lib['FileSaveMarkNotExistA'],
[
Fiddle::TYPE_VOIDP, # lpFileList : LPCSTR optional
Fiddle::TYPE_VOIDP, # lpDir : LPCSTR optional
Fiddle::TYPE_VOIDP, # lpBaseName : LPCSTR optional
],
Fiddle::TYPE_INT)#[link(name = "advpack")]
extern "system" {
fn FileSaveMarkNotExistA(
lpFileList: *const u8, // LPCSTR optional
lpDir: *const u8, // LPCSTR optional
lpBaseName: *const u8 // LPCSTR optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ADVPACK.dll", CharSet = CharSet.Ansi)]
public static extern int FileSaveMarkNotExistA([MarshalAs(UnmanagedType.LPStr)] string lpFileList, [MarshalAs(UnmanagedType.LPStr)] string lpDir, [MarshalAs(UnmanagedType.LPStr)] string lpBaseName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ADVPACK_FileSaveMarkNotExistA' -Namespace Win32 -PassThru
# $api::FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)#uselib "ADVPACK.dll"
#func global FileSaveMarkNotExistA "FileSaveMarkNotExistA" sptr, sptr, sptr
; FileSaveMarkNotExistA lpFileList, lpDir, lpBaseName ; 戻り値は stat
; lpFileList : LPCSTR optional -> "sptr"
; lpDir : LPCSTR optional -> "sptr"
; lpBaseName : LPCSTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ADVPACK.dll"
#cfunc global FileSaveMarkNotExistA "FileSaveMarkNotExistA" str, str, str
; res = FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
; lpFileList : LPCSTR optional -> "str"
; lpDir : LPCSTR optional -> "str"
; lpBaseName : LPCSTR optional -> "str"; HRESULT FileSaveMarkNotExistA(LPCSTR lpFileList, LPCSTR lpDir, LPCSTR lpBaseName)
#uselib "ADVPACK.dll"
#cfunc global FileSaveMarkNotExistA "FileSaveMarkNotExistA" str, str, str
; res = FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
; lpFileList : LPCSTR optional -> "str"
; lpDir : LPCSTR optional -> "str"
; lpBaseName : LPCSTR optional -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
advpack = windows.NewLazySystemDLL("ADVPACK.dll")
procFileSaveMarkNotExistA = advpack.NewProc("FileSaveMarkNotExistA")
)
// lpFileList (LPCSTR optional), lpDir (LPCSTR optional), lpBaseName (LPCSTR optional)
r1, _, err := procFileSaveMarkNotExistA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpFileList))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpDir))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpBaseName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction FileSaveMarkNotExistA(
lpFileList: PAnsiChar; // LPCSTR optional
lpDir: PAnsiChar; // LPCSTR optional
lpBaseName: PAnsiChar // LPCSTR optional
): Integer; stdcall;
external 'ADVPACK.dll' name 'FileSaveMarkNotExistA';result := DllCall("ADVPACK\FileSaveMarkNotExistA"
, "AStr", lpFileList ; LPCSTR optional
, "AStr", lpDir ; LPCSTR optional
, "AStr", lpBaseName ; LPCSTR optional
, "Int") ; return: HRESULT●FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName) = DLL("ADVPACK.dll", "int FileSaveMarkNotExistA(char*, char*, char*)")
# 呼び出し: FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
# lpFileList : LPCSTR optional -> "char*"
# lpDir : LPCSTR optional -> "char*"
# lpBaseName : LPCSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。