http://stackoverflow.com/questions/776174/jcldotnet-and-some-odd-calling-patterns-using-assembler
将.h转换成Delphi的pas文件:http://www.drbob42.com/headconv/index.htm
http://rvelthuis.de/articles/articles-convert.html
function CorBindToRuntimeEx(pwszVersion, pwszBuildFlavor: PWideChar;
startupFlags: DWORD; const rclsid: TCLSID; const riid: TIID;
out pv): HRESULT; stdcall;
{$EXTERNALSYM CorBindToRuntimeEx}
...
var
_CorBindToRuntimeEx: Pointer = nil;
function CorBindToRuntimeEx;
begin
GetProcedureAddress(_CorBindToRuntimeEx, mscoree_dll,
'CorBindToRuntimeEx');
asm
mov esp, ebp
pop ebp
jmp [_CorBindToRuntimeEx]
end;
end;
...
OleCheck(CorBindToRuntimeEx(PWideCharOrNil(ClrVer),
PWideChar(ClrHostFlavorNames[Flavor]), Flags,
CLASS_CorRuntimeHost, IID_ICorRuntimeHost,
FDefaultInterface));
本文介绍如何使用Assembler调用CLR(Common Language Runtime)中的函数CorBindToRuntimeEx,并提供了具体的Delphi代码实现示例。此外,还给出了通过特定工具将C头文件转换为Delphi的pas文件的方法。
346

被折叠的 条评论
为什么被折叠?



