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

ScriptString_pcOutChars

関数
解析済み文字列の出力文字数へのポインタを取得する。
DLLUSP10.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

INT* ScriptString_pcOutChars(
    void* ssa
);

パラメーター

名前方向
ssavoid*in

戻り値の型: INT*

各言語での呼び出し定義

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

INT* ScriptString_pcOutChars(
    void* ssa
);
[DllImport("USP10.dll", ExactSpelling = true)]
static extern IntPtr ScriptString_pcOutChars(
    IntPtr ssa   // void*
);
<DllImport("USP10.dll", ExactSpelling:=True)>
Public Shared Function ScriptString_pcOutChars(
    ssa As IntPtr   ' void*
) As IntPtr
End Function
' ssa : void*
Declare PtrSafe Function ScriptString_pcOutChars Lib "usp10" ( _
    ByVal ssa As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ScriptString_pcOutChars = ctypes.windll.usp10.ScriptString_pcOutChars
ScriptString_pcOutChars.restype = ctypes.c_void_p
ScriptString_pcOutChars.argtypes = [
    ctypes.POINTER(None),  # ssa : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USP10.dll')
ScriptString_pcOutChars = Fiddle::Function.new(
  lib['ScriptString_pcOutChars'],
  [
    Fiddle::TYPE_VOIDP,  # ssa : void*
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "usp10")]
extern "system" {
    fn ScriptString_pcOutChars(
        ssa: *mut ()  // void*
    ) -> *mut i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("USP10.dll")]
public static extern IntPtr ScriptString_pcOutChars(IntPtr ssa);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USP10_ScriptString_pcOutChars' -Namespace Win32 -PassThru
# $api::ScriptString_pcOutChars(ssa)
#uselib "USP10.dll"
#func global ScriptString_pcOutChars "ScriptString_pcOutChars" sptr
; ScriptString_pcOutChars ssa   ; 戻り値は stat
; ssa : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "USP10.dll"
#cfunc global ScriptString_pcOutChars "ScriptString_pcOutChars" sptr
; res = ScriptString_pcOutChars(ssa)
; ssa : void* -> "sptr"
; INT* ScriptString_pcOutChars(void* ssa)
#uselib "USP10.dll"
#cfunc global ScriptString_pcOutChars "ScriptString_pcOutChars" intptr
; res = ScriptString_pcOutChars(ssa)
; ssa : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	usp10 = windows.NewLazySystemDLL("USP10.dll")
	procScriptString_pcOutChars = usp10.NewProc("ScriptString_pcOutChars")
)

// ssa (void*)
r1, _, err := procScriptString_pcOutChars.Call(
	uintptr(ssa),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT*
function ScriptString_pcOutChars(
  ssa: Pointer   // void*
): Pointer; stdcall;
  external 'USP10.dll' name 'ScriptString_pcOutChars';
result := DllCall("USP10\ScriptString_pcOutChars"
    , "Ptr", ssa   ; void*
    , "Ptr")   ; return: INT*
●ScriptString_pcOutChars(ssa) = DLL("USP10.dll", "void* ScriptString_pcOutChars(void*)")
# 呼び出し: ScriptString_pcOutChars(ssa)
# ssa : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。