Win32 API 日本語リファレンス
ホームGlobalization › ucnv_getDefaultName

ucnv_getDefaultName

関数
現在の既定コンバーター名を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

// icuuc.dll
#include <windows.h>

LPSTR ucnv_getDefaultName(void);

パラメーターなし。戻り値: LPSTR

各言語での呼び出し定義

// icuuc.dll
#include <windows.h>

LPSTR ucnv_getDefaultName(void);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ucnv_getDefaultName();
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucnv_getDefaultName() As IntPtr
End Function
Declare PtrSafe Function ucnv_getDefaultName Lib "icuuc" () As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucnv_getDefaultName = ctypes.cdll.icuuc.ucnv_getDefaultName
ucnv_getDefaultName.restype = wintypes.LPSTR
ucnv_getDefaultName.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ucnv_getDefaultName = Fiddle::Function.new(
  lib['ucnv_getDefaultName'],
  [],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ucnv_getDefaultName() -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ucnv_getDefaultName();
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucnv_getDefaultName' -Namespace Win32 -PassThru
# $api::ucnv_getDefaultName()
#uselib "icuuc.dll"
#func global ucnv_getDefaultName "ucnv_getDefaultName"
; ucnv_getDefaultName   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global ucnv_getDefaultName "ucnv_getDefaultName"
; res = ucnv_getDefaultName()
; LPSTR ucnv_getDefaultName()
#uselib "icuuc.dll"
#cfunc global ucnv_getDefaultName "ucnv_getDefaultName"
; res = ucnv_getDefaultName()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procucnv_getDefaultName = icuuc.NewProc("ucnv_getDefaultName")
)

r1, _, err := procucnv_getDefaultName.Call()
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LPSTR
function ucnv_getDefaultName: PAnsiChar; cdecl;
  external 'icuuc.dll' name 'ucnv_getDefaultName';
result := DllCall("icuuc\ucnv_getDefaultName", "Cdecl Ptr")
●ucnv_getDefaultName() = DLL("icuuc.dll", "char* ucnv_getDefaultName()")
# 呼び出し: ucnv_getDefaultName()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。