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

u_strcat

関数
UChar文字列を連結する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

WORD* u_strcat(
    WORD* dst,
    const WORD* src
);

パラメーター

名前方向
dstWORD*inout
srcWORD*in

戻り値の型: WORD*

各言語での呼び出し定義

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

WORD* u_strcat(
    WORD* dst,
    const WORD* src
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr u_strcat(
    ref ushort dst,   // WORD* in/out
    ref ushort src   // WORD*
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function u_strcat(
    ByRef dst As UShort,   ' WORD* in/out
    ByRef src As UShort   ' WORD*
) As IntPtr
End Function
' dst : WORD* in/out
' src : WORD*
Declare PtrSafe Function u_strcat Lib "icuuc" ( _
    ByRef dst As Integer, _
    ByRef src As Integer) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

u_strcat = ctypes.cdll.icuuc.u_strcat
u_strcat.restype = ctypes.c_void_p
u_strcat.argtypes = [
    ctypes.POINTER(ctypes.c_ushort),  # dst : WORD* in/out
    ctypes.POINTER(ctypes.c_ushort),  # src : WORD*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
u_strcat = Fiddle::Function.new(
  lib['u_strcat'],
  [
    Fiddle::TYPE_VOIDP,  # dst : WORD* in/out
    Fiddle::TYPE_VOIDP,  # src : WORD*
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn u_strcat(
        dst: *mut u16,  // WORD* in/out
        src: *const u16  // WORD*
    ) -> *mut u16;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr u_strcat(ref ushort dst, ref ushort src);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_u_strcat' -Namespace Win32 -PassThru
# $api::u_strcat(dst, src)
#uselib "icuuc.dll"
#func global u_strcat "u_strcat" sptr, sptr
; u_strcat varptr(dst), varptr(src)   ; 戻り値は stat
; dst : WORD* in/out -> "sptr"
; src : WORD* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuuc.dll"
#cfunc global u_strcat "u_strcat" var, var
; res = u_strcat(dst, src)
; dst : WORD* in/out -> "var"
; src : WORD* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; WORD* u_strcat(WORD* dst, WORD* src)
#uselib "icuuc.dll"
#cfunc global u_strcat "u_strcat" var, var
; res = u_strcat(dst, src)
; dst : WORD* in/out -> "var"
; src : WORD* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procu_strcat = icuuc.NewProc("u_strcat")
)

// dst (WORD* in/out), src (WORD*)
r1, _, err := procu_strcat.Call(
	uintptr(dst),
	uintptr(src),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // WORD*
function u_strcat(
  dst: Pointer;   // WORD* in/out
  src: Pointer   // WORD*
): Pointer; cdecl;
  external 'icuuc.dll' name 'u_strcat';
result := DllCall("icuuc\u_strcat"
    , "Ptr", dst   ; WORD* in/out
    , "Ptr", src   ; WORD*
    , "Cdecl Ptr")   ; return: WORD*
●u_strcat(dst, src) = DLL("icuuc.dll", "void* u_strcat(void*, void*)")
# 呼び出し: u_strcat(dst, src)
# dst : WORD* in/out -> "void*"
# src : WORD* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。