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