ホーム › UI.TabletPC › GetResultPropertyList
GetResultPropertyList
関数認識結果が対応するプロパティ一覧を取得する。
シグネチャ
// inkobjcore.dll
#include <windows.h>
HRESULT GetResultPropertyList(
HRECOGNIZER hrec,
DWORD* pPropertyCount,
GUID* pPropertyGuid
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hrec | HRECOGNIZER | in | 対象の認識エンジンのハンドル(HRECOGNIZER)。 |
| pPropertyCount | DWORD* | inout | プロパティ数を入出力するポインタ。入力でバッファ容量、出力で実際の数。 |
| pPropertyGuid | GUID* | inout | サポートする結果プロパティのGUID配列を受け取るポインタ。NULLで個数のみ取得。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// inkobjcore.dll
#include <windows.h>
HRESULT GetResultPropertyList(
HRECOGNIZER hrec,
DWORD* pPropertyCount,
GUID* pPropertyGuid
);[DllImport("inkobjcore.dll", ExactSpelling = true)]
static extern int GetResultPropertyList(
IntPtr hrec, // HRECOGNIZER
ref uint pPropertyCount, // DWORD* in/out
ref Guid pPropertyGuid // GUID* in/out
);<DllImport("inkobjcore.dll", ExactSpelling:=True)>
Public Shared Function GetResultPropertyList(
hrec As IntPtr, ' HRECOGNIZER
ByRef pPropertyCount As UInteger, ' DWORD* in/out
ByRef pPropertyGuid As Guid ' GUID* in/out
) As Integer
End Function' hrec : HRECOGNIZER
' pPropertyCount : DWORD* in/out
' pPropertyGuid : GUID* in/out
Declare PtrSafe Function GetResultPropertyList Lib "inkobjcore" ( _
ByVal hrec As LongPtr, _
ByRef pPropertyCount As Long, _
ByVal pPropertyGuid As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetResultPropertyList = ctypes.windll.inkobjcore.GetResultPropertyList
GetResultPropertyList.restype = ctypes.c_int
GetResultPropertyList.argtypes = [
wintypes.HANDLE, # hrec : HRECOGNIZER
ctypes.POINTER(wintypes.DWORD), # pPropertyCount : DWORD* in/out
ctypes.c_void_p, # pPropertyGuid : GUID* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('inkobjcore.dll')
GetResultPropertyList = Fiddle::Function.new(
lib['GetResultPropertyList'],
[
Fiddle::TYPE_VOIDP, # hrec : HRECOGNIZER
Fiddle::TYPE_VOIDP, # pPropertyCount : DWORD* in/out
Fiddle::TYPE_VOIDP, # pPropertyGuid : GUID* in/out
],
Fiddle::TYPE_INT)#[link(name = "inkobjcore")]
extern "system" {
fn GetResultPropertyList(
hrec: *mut core::ffi::c_void, // HRECOGNIZER
pPropertyCount: *mut u32, // DWORD* in/out
pPropertyGuid: *mut GUID // GUID* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("inkobjcore.dll")]
public static extern int GetResultPropertyList(IntPtr hrec, ref uint pPropertyCount, ref Guid pPropertyGuid);
"@
$api = Add-Type -MemberDefinition $sig -Name 'inkobjcore_GetResultPropertyList' -Namespace Win32 -PassThru
# $api::GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid)#uselib "inkobjcore.dll"
#func global GetResultPropertyList "GetResultPropertyList" sptr, sptr, sptr
; GetResultPropertyList hrec, varptr(pPropertyCount), varptr(pPropertyGuid) ; 戻り値は stat
; hrec : HRECOGNIZER -> "sptr"
; pPropertyCount : DWORD* in/out -> "sptr"
; pPropertyGuid : GUID* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "inkobjcore.dll" #cfunc global GetResultPropertyList "GetResultPropertyList" sptr, var, var ; res = GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid) ; hrec : HRECOGNIZER -> "sptr" ; pPropertyCount : DWORD* in/out -> "var" ; pPropertyGuid : GUID* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "inkobjcore.dll" #cfunc global GetResultPropertyList "GetResultPropertyList" sptr, sptr, sptr ; res = GetResultPropertyList(hrec, varptr(pPropertyCount), varptr(pPropertyGuid)) ; hrec : HRECOGNIZER -> "sptr" ; pPropertyCount : DWORD* in/out -> "sptr" ; pPropertyGuid : GUID* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT GetResultPropertyList(HRECOGNIZER hrec, DWORD* pPropertyCount, GUID* pPropertyGuid) #uselib "inkobjcore.dll" #cfunc global GetResultPropertyList "GetResultPropertyList" intptr, var, var ; res = GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid) ; hrec : HRECOGNIZER -> "intptr" ; pPropertyCount : DWORD* in/out -> "var" ; pPropertyGuid : GUID* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT GetResultPropertyList(HRECOGNIZER hrec, DWORD* pPropertyCount, GUID* pPropertyGuid) #uselib "inkobjcore.dll" #cfunc global GetResultPropertyList "GetResultPropertyList" intptr, intptr, intptr ; res = GetResultPropertyList(hrec, varptr(pPropertyCount), varptr(pPropertyGuid)) ; hrec : HRECOGNIZER -> "intptr" ; pPropertyCount : DWORD* in/out -> "intptr" ; pPropertyGuid : GUID* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
inkobjcore = windows.NewLazySystemDLL("inkobjcore.dll")
procGetResultPropertyList = inkobjcore.NewProc("GetResultPropertyList")
)
// hrec (HRECOGNIZER), pPropertyCount (DWORD* in/out), pPropertyGuid (GUID* in/out)
r1, _, err := procGetResultPropertyList.Call(
uintptr(hrec),
uintptr(pPropertyCount),
uintptr(pPropertyGuid),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction GetResultPropertyList(
hrec: THandle; // HRECOGNIZER
pPropertyCount: Pointer; // DWORD* in/out
pPropertyGuid: PGUID // GUID* in/out
): Integer; stdcall;
external 'inkobjcore.dll' name 'GetResultPropertyList';result := DllCall("inkobjcore\GetResultPropertyList"
, "Ptr", hrec ; HRECOGNIZER
, "Ptr", pPropertyCount ; DWORD* in/out
, "Ptr", pPropertyGuid ; GUID* in/out
, "Int") ; return: HRESULT●GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid) = DLL("inkobjcore.dll", "int GetResultPropertyList(void*, void*, void*)")
# 呼び出し: GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid)
# hrec : HRECOGNIZER -> "void*"
# pPropertyCount : DWORD* in/out -> "void*"
# pPropertyGuid : GUID* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "inkobjcore" fn GetResultPropertyList(
hrec: ?*anyopaque, // HRECOGNIZER
pPropertyCount: [*c]u32, // DWORD* in/out
pPropertyGuid: [*c]GUID // GUID* in/out
) callconv(std.os.windows.WINAPI) i32;proc GetResultPropertyList(
hrec: pointer, # HRECOGNIZER
pPropertyCount: ptr uint32, # DWORD* in/out
pPropertyGuid: ptr GUID # GUID* in/out
): int32 {.importc: "GetResultPropertyList", stdcall, dynlib: "inkobjcore.dll".}pragma(lib, "inkobjcore");
extern(Windows)
int GetResultPropertyList(
void* hrec, // HRECOGNIZER
uint* pPropertyCount, // DWORD* in/out
GUID* pPropertyGuid // GUID* in/out
);ccall((:GetResultPropertyList, "inkobjcore.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{UInt32}, Ptr{GUID}),
hrec, pPropertyCount, pPropertyGuid)
# hrec : HRECOGNIZER -> Ptr{Cvoid}
# pPropertyCount : DWORD* in/out -> Ptr{UInt32}
# pPropertyGuid : GUID* in/out -> Ptr{GUID}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GetResultPropertyList(
void* hrec,
uint32_t* pPropertyCount,
void* pPropertyGuid);
]]
local inkobjcore = ffi.load("inkobjcore")
-- inkobjcore.GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid)
-- hrec : HRECOGNIZER
-- pPropertyCount : DWORD* in/out
-- pPropertyGuid : GUID* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('inkobjcore.dll');
const GetResultPropertyList = lib.func('__stdcall', 'GetResultPropertyList', 'int32_t', ['void *', 'uint32_t *', 'void *']);
// GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid)
// hrec : HRECOGNIZER -> 'void *'
// pPropertyCount : DWORD* in/out -> 'uint32_t *'
// pPropertyGuid : GUID* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("inkobjcore.dll", {
GetResultPropertyList: { parameters: ["pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid)
// hrec : HRECOGNIZER -> "pointer"
// pPropertyCount : DWORD* in/out -> "pointer"
// pPropertyGuid : GUID* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GetResultPropertyList(
void* hrec,
uint32_t* pPropertyCount,
void* pPropertyGuid);
C, "inkobjcore.dll");
// $ffi->GetResultPropertyList(hrec, pPropertyCount, pPropertyGuid);
// hrec : HRECOGNIZER
// pPropertyCount : DWORD* in/out
// pPropertyGuid : GUID* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Inkobjcore extends StdCallLibrary {
Inkobjcore INSTANCE = Native.load("inkobjcore", Inkobjcore.class);
int GetResultPropertyList(
Pointer hrec, // HRECOGNIZER
IntByReference pPropertyCount, // DWORD* in/out
Pointer pPropertyGuid // GUID* in/out
);
}@[Link("inkobjcore")]
lib Libinkobjcore
fun GetResultPropertyList = GetResultPropertyList(
hrec : Void*, # HRECOGNIZER
pPropertyCount : UInt32*, # DWORD* in/out
pPropertyGuid : GUID* # GUID* in/out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GetResultPropertyListNative = Int32 Function(Pointer<Void>, Pointer<Uint32>, Pointer<Void>);
typedef GetResultPropertyListDart = int Function(Pointer<Void>, Pointer<Uint32>, Pointer<Void>);
final GetResultPropertyList = DynamicLibrary.open('inkobjcore.dll')
.lookupFunction<GetResultPropertyListNative, GetResultPropertyListDart>('GetResultPropertyList');
// hrec : HRECOGNIZER -> Pointer<Void>
// pPropertyCount : DWORD* in/out -> Pointer<Uint32>
// pPropertyGuid : GUID* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GetResultPropertyList(
hrec: THandle; // HRECOGNIZER
pPropertyCount: Pointer; // DWORD* in/out
pPropertyGuid: PGUID // GUID* in/out
): Integer; stdcall;
external 'inkobjcore.dll' name 'GetResultPropertyList';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GetResultPropertyList"
c_GetResultPropertyList :: Ptr () -> Ptr Word32 -> Ptr () -> IO Int32
-- hrec : HRECOGNIZER -> Ptr ()
-- pPropertyCount : DWORD* in/out -> Ptr Word32
-- pPropertyGuid : GUID* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let getresultpropertylist =
foreign "GetResultPropertyList"
((ptr void) @-> (ptr uint32_t) @-> (ptr void) @-> returning int32_t)
(* hrec : HRECOGNIZER -> (ptr void) *)
(* pPropertyCount : DWORD* in/out -> (ptr uint32_t) *)
(* pPropertyGuid : GUID* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library inkobjcore (t "inkobjcore.dll"))
(cffi:use-foreign-library inkobjcore)
(cffi:defcfun ("GetResultPropertyList" get-result-property-list :convention :stdcall) :int32
(hrec :pointer) ; HRECOGNIZER
(p-property-count :pointer) ; DWORD* in/out
(p-property-guid :pointer)) ; GUID* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GetResultPropertyList = Win32::API::More->new('inkobjcore',
'int GetResultPropertyList(HANDLE hrec, LPVOID pPropertyCount, LPVOID pPropertyGuid)');
# my $ret = $GetResultPropertyList->Call($hrec, $pPropertyCount, $pPropertyGuid);
# hrec : HRECOGNIZER -> HANDLE
# pPropertyCount : DWORD* in/out -> LPVOID
# pPropertyGuid : GUID* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。