ホーム › Globalization › MappingDoAction
MappingDoAction
関数認識結果の指定範囲に対しELSアクションを実行する。
シグネチャ
// elscore.dll
#include <windows.h>
HRESULT MappingDoAction(
MAPPING_PROPERTY_BAG* pBag,
DWORD dwRangeIndex,
LPCWSTR pszActionId
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pBag | MAPPING_PROPERTY_BAG* | inout |
| dwRangeIndex | DWORD | in |
| pszActionId | LPCWSTR | in |
戻り値の型: 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 方式にも切替可。#uselib "elscore.dll" #cfunc global MappingDoAction "MappingDoAction" sptr, int, wstr ; res = MappingDoAction(varptr(pBag), dwRangeIndex, pszActionId) ; pBag : MAPPING_PROPERTY_BAG* in/out -> "sptr" ; dwRangeIndex : DWORD -> "int" ; pszActionId : LPCWSTR -> "wstr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; HRESULT MappingDoAction(MAPPING_PROPERTY_BAG* pBag, DWORD dwRangeIndex, LPCWSTR pszActionId) #uselib "elscore.dll" #cfunc global MappingDoAction "MappingDoAction" intptr, int, wstr ; res = MappingDoAction(varptr(pBag), dwRangeIndex, pszActionId) ; pBag : MAPPING_PROPERTY_BAG* in/out -> "intptr" ; dwRangeIndex : DWORD -> "int" ; pszActionId : LPCWSTR -> "wstr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // HRESULTfunction 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)。