Win32 API 日本語リファレンス
ホームDevices.AllJoyn › alljoyn_interfacedescription_getdescriptionforlanguage

alljoyn_interfacedescription_getdescriptionforlanguage

関数
指定言語のインターフェイス説明文を取得する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

UINT_PTR alljoyn_interfacedescription_getdescriptionforlanguage(
    alljoyn_interfacedescription iface,
    LPSTR description,
    UINT_PTR maxLanguageLength,
    LPCSTR languageTag
);

パラメーター

名前方向
ifacealljoyn_interfacedescriptionin
descriptionLPSTRin
maxLanguageLengthUINT_PTRin
languageTagLPCSTRin

戻り値の型: UINT_PTR

各言語での呼び出し定義

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

UINT_PTR alljoyn_interfacedescription_getdescriptionforlanguage(
    alljoyn_interfacedescription iface,
    LPSTR description,
    UINT_PTR maxLanguageLength,
    LPCSTR languageTag
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern UIntPtr alljoyn_interfacedescription_getdescriptionforlanguage(
    IntPtr iface,   // alljoyn_interfacedescription
    [MarshalAs(UnmanagedType.LPStr)] string description,   // LPSTR
    UIntPtr maxLanguageLength,   // UINT_PTR
    [MarshalAs(UnmanagedType.LPStr)] string languageTag   // LPCSTR
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_interfacedescription_getdescriptionforlanguage(
    iface As IntPtr,   ' alljoyn_interfacedescription
    <MarshalAs(UnmanagedType.LPStr)> description As String,   ' LPSTR
    maxLanguageLength As UIntPtr,   ' UINT_PTR
    <MarshalAs(UnmanagedType.LPStr)> languageTag As String   ' LPCSTR
) As UIntPtr
End Function
' iface : alljoyn_interfacedescription
' description : LPSTR
' maxLanguageLength : UINT_PTR
' languageTag : LPCSTR
Declare PtrSafe Function alljoyn_interfacedescription_getdescriptionforlanguage Lib "msajapi" ( _
    ByVal iface As LongPtr, _
    ByVal description As String, _
    ByVal maxLanguageLength As LongPtr, _
    ByVal languageTag As String) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_interfacedescription_getdescriptionforlanguage = ctypes.windll.msajapi.alljoyn_interfacedescription_getdescriptionforlanguage
alljoyn_interfacedescription_getdescriptionforlanguage.restype = ctypes.c_size_t
alljoyn_interfacedescription_getdescriptionforlanguage.argtypes = [
    ctypes.c_ssize_t,  # iface : alljoyn_interfacedescription
    wintypes.LPCSTR,  # description : LPSTR
    ctypes.c_size_t,  # maxLanguageLength : UINT_PTR
    wintypes.LPCSTR,  # languageTag : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_getdescriptionforlanguage = Fiddle::Function.new(
  lib['alljoyn_interfacedescription_getdescriptionforlanguage'],
  [
    Fiddle::TYPE_INTPTR_T,  # iface : alljoyn_interfacedescription
    Fiddle::TYPE_VOIDP,  # description : LPSTR
    Fiddle::TYPE_UINTPTR_T,  # maxLanguageLength : UINT_PTR
    Fiddle::TYPE_VOIDP,  # languageTag : LPCSTR
  ],
  Fiddle::TYPE_UINTPTR_T)
#[link(name = "msajapi")]
extern "system" {
    fn alljoyn_interfacedescription_getdescriptionforlanguage(
        iface: isize,  // alljoyn_interfacedescription
        description: *mut u8,  // LPSTR
        maxLanguageLength: usize,  // UINT_PTR
        languageTag: *const u8  // LPCSTR
    ) -> usize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSAJApi.dll")]
public static extern UIntPtr alljoyn_interfacedescription_getdescriptionforlanguage(IntPtr iface, [MarshalAs(UnmanagedType.LPStr)] string description, UIntPtr maxLanguageLength, [MarshalAs(UnmanagedType.LPStr)] string languageTag);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_getdescriptionforlanguage' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_getdescriptionforlanguage(iface, description, maxLanguageLength, languageTag)
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_getdescriptionforlanguage "alljoyn_interfacedescription_getdescriptionforlanguage" sptr, sptr, sptr, sptr
; alljoyn_interfacedescription_getdescriptionforlanguage iface, description, maxLanguageLength, languageTag   ; 戻り値は stat
; iface : alljoyn_interfacedescription -> "sptr"
; description : LPSTR -> "sptr"
; maxLanguageLength : UINT_PTR -> "sptr"
; languageTag : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_getdescriptionforlanguage "alljoyn_interfacedescription_getdescriptionforlanguage" sptr, str, sptr, str
; res = alljoyn_interfacedescription_getdescriptionforlanguage(iface, description, maxLanguageLength, languageTag)
; iface : alljoyn_interfacedescription -> "sptr"
; description : LPSTR -> "str"
; maxLanguageLength : UINT_PTR -> "sptr"
; languageTag : LPCSTR -> "str"
; UINT_PTR alljoyn_interfacedescription_getdescriptionforlanguage(alljoyn_interfacedescription iface, LPSTR description, UINT_PTR maxLanguageLength, LPCSTR languageTag)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_getdescriptionforlanguage "alljoyn_interfacedescription_getdescriptionforlanguage" intptr, str, intptr, str
; res = alljoyn_interfacedescription_getdescriptionforlanguage(iface, description, maxLanguageLength, languageTag)
; iface : alljoyn_interfacedescription -> "intptr"
; description : LPSTR -> "str"
; maxLanguageLength : UINT_PTR -> "intptr"
; languageTag : LPCSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_interfacedescription_getdescriptionforlanguage = msajapi.NewProc("alljoyn_interfacedescription_getdescriptionforlanguage")
)

// iface (alljoyn_interfacedescription), description (LPSTR), maxLanguageLength (UINT_PTR), languageTag (LPCSTR)
r1, _, err := procalljoyn_interfacedescription_getdescriptionforlanguage.Call(
	uintptr(iface),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(description))),
	uintptr(maxLanguageLength),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(languageTag))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // UINT_PTR
function alljoyn_interfacedescription_getdescriptionforlanguage(
  iface: NativeInt;   // alljoyn_interfacedescription
  description: PAnsiChar;   // LPSTR
  maxLanguageLength: NativeUInt;   // UINT_PTR
  languageTag: PAnsiChar   // LPCSTR
): NativeUInt; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_interfacedescription_getdescriptionforlanguage';
result := DllCall("MSAJApi\alljoyn_interfacedescription_getdescriptionforlanguage"
    , "Ptr", iface   ; alljoyn_interfacedescription
    , "AStr", description   ; LPSTR
    , "UPtr", maxLanguageLength   ; UINT_PTR
    , "AStr", languageTag   ; LPCSTR
    , "UPtr")   ; return: UINT_PTR
●alljoyn_interfacedescription_getdescriptionforlanguage(iface, description, maxLanguageLength, languageTag) = DLL("MSAJApi.dll", "int alljoyn_interfacedescription_getdescriptionforlanguage(int, char*, int, char*)")
# 呼び出し: alljoyn_interfacedescription_getdescriptionforlanguage(iface, description, maxLanguageLength, languageTag)
# iface : alljoyn_interfacedescription -> "int"
# description : LPSTR -> "char*"
# maxLanguageLength : UINT_PTR -> "int"
# languageTag : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。