ホーム › System.Ole › GetAltMonthNames
GetAltMonthNames
関数指定ロケールの代替月名の配列を取得する。
シグネチャ
// OLEAUT32.dll
#include <windows.h>
HRESULT GetAltMonthNames(
DWORD lcid,
LPWSTR** prgp
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lcid | DWORD | in |
| prgp | LPWSTR** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// OLEAUT32.dll
#include <windows.h>
HRESULT GetAltMonthNames(
DWORD lcid,
LPWSTR** prgp
);[DllImport("OLEAUT32.dll", ExactSpelling = true)]
static extern int GetAltMonthNames(
uint lcid, // DWORD
IntPtr prgp // LPWSTR** out
);<DllImport("OLEAUT32.dll", ExactSpelling:=True)>
Public Shared Function GetAltMonthNames(
lcid As UInteger, ' DWORD
prgp As IntPtr ' LPWSTR** out
) As Integer
End Function' lcid : DWORD
' prgp : LPWSTR** out
Declare PtrSafe Function GetAltMonthNames Lib "oleaut32" ( _
ByVal lcid As Long, _
ByVal prgp As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetAltMonthNames = ctypes.windll.oleaut32.GetAltMonthNames
GetAltMonthNames.restype = ctypes.c_int
GetAltMonthNames.argtypes = [
wintypes.DWORD, # lcid : DWORD
ctypes.c_void_p, # prgp : LPWSTR** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLEAUT32.dll')
GetAltMonthNames = Fiddle::Function.new(
lib['GetAltMonthNames'],
[
-Fiddle::TYPE_INT, # lcid : DWORD
Fiddle::TYPE_VOIDP, # prgp : LPWSTR** out
],
Fiddle::TYPE_INT)#[link(name = "oleaut32")]
extern "system" {
fn GetAltMonthNames(
lcid: u32, // DWORD
prgp: *mut *mut *mut u16 // LPWSTR** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLEAUT32.dll")]
public static extern int GetAltMonthNames(uint lcid, IntPtr prgp);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEAUT32_GetAltMonthNames' -Namespace Win32 -PassThru
# $api::GetAltMonthNames(lcid, prgp)#uselib "OLEAUT32.dll"
#func global GetAltMonthNames "GetAltMonthNames" sptr, sptr
; GetAltMonthNames lcid, varptr(prgp) ; 戻り値は stat
; lcid : DWORD -> "sptr"
; prgp : LPWSTR** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "OLEAUT32.dll" #cfunc global GetAltMonthNames "GetAltMonthNames" int, var ; res = GetAltMonthNames(lcid, prgp) ; lcid : DWORD -> "int" ; prgp : LPWSTR** out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "OLEAUT32.dll" #cfunc global GetAltMonthNames "GetAltMonthNames" int, sptr ; res = GetAltMonthNames(lcid, varptr(prgp)) ; lcid : DWORD -> "int" ; prgp : LPWSTR** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT GetAltMonthNames(DWORD lcid, LPWSTR** prgp) #uselib "OLEAUT32.dll" #cfunc global GetAltMonthNames "GetAltMonthNames" int, var ; res = GetAltMonthNames(lcid, prgp) ; lcid : DWORD -> "int" ; prgp : LPWSTR** out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT GetAltMonthNames(DWORD lcid, LPWSTR** prgp) #uselib "OLEAUT32.dll" #cfunc global GetAltMonthNames "GetAltMonthNames" int, intptr ; res = GetAltMonthNames(lcid, varptr(prgp)) ; lcid : DWORD -> "int" ; prgp : LPWSTR** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
oleaut32 = windows.NewLazySystemDLL("OLEAUT32.dll")
procGetAltMonthNames = oleaut32.NewProc("GetAltMonthNames")
)
// lcid (DWORD), prgp (LPWSTR** out)
r1, _, err := procGetAltMonthNames.Call(
uintptr(lcid),
uintptr(prgp),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction GetAltMonthNames(
lcid: DWORD; // DWORD
prgp: PPWideChar // LPWSTR** out
): Integer; stdcall;
external 'OLEAUT32.dll' name 'GetAltMonthNames';result := DllCall("OLEAUT32\GetAltMonthNames"
, "UInt", lcid ; DWORD
, "Ptr", prgp ; LPWSTR** out
, "Int") ; return: HRESULT●GetAltMonthNames(lcid, prgp) = DLL("OLEAUT32.dll", "int GetAltMonthNames(dword, void*)")
# 呼び出し: GetAltMonthNames(lcid, prgp)
# lcid : DWORD -> "dword"
# prgp : LPWSTR** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。