ホーム › Media.MediaFoundation › MFCreateSample
MFCreateSample
関数空のメディアサンプルオブジェクトを生成する。
シグネチャ
// MFPlat.dll
#include <windows.h>
HRESULT MFCreateSample(
IMFSample** ppIMFSample
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ppIMFSample | IMFSample** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// MFPlat.dll
#include <windows.h>
HRESULT MFCreateSample(
IMFSample** ppIMFSample
);[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern int MFCreateSample(
IntPtr ppIMFSample // IMFSample** out
);<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFCreateSample(
ppIMFSample As IntPtr ' IMFSample** out
) As Integer
End Function' ppIMFSample : IMFSample** out
Declare PtrSafe Function MFCreateSample Lib "mfplat" ( _
ByVal ppIMFSample As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MFCreateSample = ctypes.windll.mfplat.MFCreateSample
MFCreateSample.restype = ctypes.c_int
MFCreateSample.argtypes = [
ctypes.c_void_p, # ppIMFSample : IMFSample** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MFPlat.dll')
MFCreateSample = Fiddle::Function.new(
lib['MFCreateSample'],
[
Fiddle::TYPE_VOIDP, # ppIMFSample : IMFSample** out
],
Fiddle::TYPE_INT)#[link(name = "mfplat")]
extern "system" {
fn MFCreateSample(
ppIMFSample: *mut *mut core::ffi::c_void // IMFSample** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MFPlat.dll")]
public static extern int MFCreateSample(IntPtr ppIMFSample);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFCreateSample' -Namespace Win32 -PassThru
# $api::MFCreateSample(ppIMFSample)#uselib "MFPlat.dll"
#func global MFCreateSample "MFCreateSample" sptr
; MFCreateSample ppIMFSample ; 戻り値は stat
; ppIMFSample : IMFSample** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MFPlat.dll"
#cfunc global MFCreateSample "MFCreateSample" sptr
; res = MFCreateSample(ppIMFSample)
; ppIMFSample : IMFSample** out -> "sptr"; HRESULT MFCreateSample(IMFSample** ppIMFSample)
#uselib "MFPlat.dll"
#cfunc global MFCreateSample "MFCreateSample" intptr
; res = MFCreateSample(ppIMFSample)
; ppIMFSample : IMFSample** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mfplat = windows.NewLazySystemDLL("MFPlat.dll")
procMFCreateSample = mfplat.NewProc("MFCreateSample")
)
// ppIMFSample (IMFSample** out)
r1, _, err := procMFCreateSample.Call(
uintptr(ppIMFSample),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MFCreateSample(
ppIMFSample: Pointer // IMFSample** out
): Integer; stdcall;
external 'MFPlat.dll' name 'MFCreateSample';result := DllCall("MFPlat\MFCreateSample"
, "Ptr", ppIMFSample ; IMFSample** out
, "Int") ; return: HRESULT●MFCreateSample(ppIMFSample) = DLL("MFPlat.dll", "int MFCreateSample(void*)")
# 呼び出し: MFCreateSample(ppIMFSample)
# ppIMFSample : IMFSample** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。