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