ホーム › Globalization › GetOEMCP
GetOEMCP
関数システムの現在のOEMコードページを取得する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
DWORD GetOEMCP(void);パラメーターなし。戻り値: DWORD
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
DWORD GetOEMCP(void);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern uint GetOEMCP();<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function GetOEMCP() As UInteger
End FunctionDeclare PtrSafe Function GetOEMCP Lib "kernel32" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetOEMCP = ctypes.windll.kernel32.GetOEMCP
GetOEMCP.restype = wintypes.DWORD
GetOEMCP.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
GetOEMCP = Fiddle::Function.new(
lib['GetOEMCP'],
[],
-Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn GetOEMCP() -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern uint GetOEMCP();
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_GetOEMCP' -Namespace Win32 -PassThru
# $api::GetOEMCP()#uselib "KERNEL32.dll"
#func global GetOEMCP "GetOEMCP"
; GetOEMCP ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global GetOEMCP "GetOEMCP"
; res = GetOEMCP(); DWORD GetOEMCP()
#uselib "KERNEL32.dll"
#cfunc global GetOEMCP "GetOEMCP"
; res = GetOEMCP()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procGetOEMCP = kernel32.NewProc("GetOEMCP")
)
r1, _, err := procGetOEMCP.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction GetOEMCP: DWORD; stdcall;
external 'KERNEL32.dll' name 'GetOEMCP';result := DllCall("KERNEL32\GetOEMCP", "UInt")●GetOEMCP() = DLL("KERNEL32.dll", "dword GetOEMCP()")
# 呼び出し: GetOEMCP()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。