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