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

MappingDoAction

関数
認識結果の指定範囲に対しELSアクションを実行する。
DLLelscore.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT MappingDoAction(
    MAPPING_PROPERTY_BAG* pBag,
    DWORD dwRangeIndex,
    LPCWSTR pszActionId
);

パラメーター

名前方向
pBagMAPPING_PROPERTY_BAG*inout
dwRangeIndexDWORDin
pszActionIdLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT MappingDoAction(
    MAPPING_PROPERTY_BAG* pBag,
    DWORD dwRangeIndex,
    LPCWSTR pszActionId
);
[DllImport("elscore.dll", ExactSpelling = true)]
static extern int MappingDoAction(
    IntPtr pBag,   // MAPPING_PROPERTY_BAG* in/out
    uint dwRangeIndex,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string pszActionId   // LPCWSTR
);
<DllImport("elscore.dll", ExactSpelling:=True)>
Public Shared Function MappingDoAction(
    pBag As IntPtr,   ' MAPPING_PROPERTY_BAG* in/out
    dwRangeIndex As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> pszActionId As String   ' LPCWSTR
) As Integer
End Function
' pBag : MAPPING_PROPERTY_BAG* in/out
' dwRangeIndex : DWORD
' pszActionId : LPCWSTR
Declare PtrSafe Function MappingDoAction Lib "elscore" ( _
    ByVal pBag As LongPtr, _
    ByVal dwRangeIndex As Long, _
    ByVal pszActionId As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MappingDoAction = ctypes.windll.elscore.MappingDoAction
MappingDoAction.restype = ctypes.c_int
MappingDoAction.argtypes = [
    ctypes.c_void_p,  # pBag : MAPPING_PROPERTY_BAG* in/out
    wintypes.DWORD,  # dwRangeIndex : DWORD
    wintypes.LPCWSTR,  # pszActionId : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('elscore.dll')
MappingDoAction = Fiddle::Function.new(
  lib['MappingDoAction'],
  [
    Fiddle::TYPE_VOIDP,  # pBag : MAPPING_PROPERTY_BAG* in/out
    -Fiddle::TYPE_INT,  # dwRangeIndex : DWORD
    Fiddle::TYPE_VOIDP,  # pszActionId : LPCWSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "elscore")]
extern "system" {
    fn MappingDoAction(
        pBag: *mut MAPPING_PROPERTY_BAG,  // MAPPING_PROPERTY_BAG* in/out
        dwRangeIndex: u32,  // DWORD
        pszActionId: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("elscore.dll")]
public static extern int MappingDoAction(IntPtr pBag, uint dwRangeIndex, [MarshalAs(UnmanagedType.LPWStr)] string pszActionId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'elscore_MappingDoAction' -Namespace Win32 -PassThru
# $api::MappingDoAction(pBag, dwRangeIndex, pszActionId)
#uselib "elscore.dll"
#func global MappingDoAction "MappingDoAction" sptr, sptr, sptr
; MappingDoAction varptr(pBag), dwRangeIndex, pszActionId   ; 戻り値は stat
; pBag : MAPPING_PROPERTY_BAG* in/out -> "sptr"
; dwRangeIndex : DWORD -> "sptr"
; pszActionId : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "elscore.dll"
#cfunc global MappingDoAction "MappingDoAction" var, int, wstr
; res = MappingDoAction(pBag, dwRangeIndex, pszActionId)
; pBag : MAPPING_PROPERTY_BAG* in/out -> "var"
; dwRangeIndex : DWORD -> "int"
; pszActionId : LPCWSTR -> "wstr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT MappingDoAction(MAPPING_PROPERTY_BAG* pBag, DWORD dwRangeIndex, LPCWSTR pszActionId)
#uselib "elscore.dll"
#cfunc global MappingDoAction "MappingDoAction" var, int, wstr
; res = MappingDoAction(pBag, dwRangeIndex, pszActionId)
; pBag : MAPPING_PROPERTY_BAG* in/out -> "var"
; dwRangeIndex : DWORD -> "int"
; pszActionId : LPCWSTR -> "wstr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	elscore = windows.NewLazySystemDLL("elscore.dll")
	procMappingDoAction = elscore.NewProc("MappingDoAction")
)

// pBag (MAPPING_PROPERTY_BAG* in/out), dwRangeIndex (DWORD), pszActionId (LPCWSTR)
r1, _, err := procMappingDoAction.Call(
	uintptr(pBag),
	uintptr(dwRangeIndex),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszActionId))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function MappingDoAction(
  pBag: Pointer;   // MAPPING_PROPERTY_BAG* in/out
  dwRangeIndex: DWORD;   // DWORD
  pszActionId: PWideChar   // LPCWSTR
): Integer; stdcall;
  external 'elscore.dll' name 'MappingDoAction';
result := DllCall("elscore\MappingDoAction"
    , "Ptr", pBag   ; MAPPING_PROPERTY_BAG* in/out
    , "UInt", dwRangeIndex   ; DWORD
    , "WStr", pszActionId   ; LPCWSTR
    , "Int")   ; return: HRESULT
●MappingDoAction(pBag, dwRangeIndex, pszActionId) = DLL("elscore.dll", "int MappingDoAction(void*, dword, char*)")
# 呼び出し: MappingDoAction(pBag, dwRangeIndex, pszActionId)
# pBag : MAPPING_PROPERTY_BAG* in/out -> "void*"
# dwRangeIndex : DWORD -> "dword"
# pszActionId : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。