📄 testdll.dpr
字号:
library TestDLL;
uses
SysUtils, Dialogs, Windows, WOW32;
const
DLLStr = '这是32位DLL文件。16位EXE传递来的字符串是: "%s"';
function DLLFunc32(P: PChar; CallBackFunc: DWORD): Integer; stdcall;
const
MemSize = 256;
var
Mem16: DWORD;
Mem32: PChar;
Hand16: word;
begin
ShowMessage(Format(DLLStr, [P]));
Hand16 := WOWGlobalAlloc16(GMem_Share or GMem_Fixed or GMem_ZeroInit,
MemSize);
Mem16 := WOWGlobalLock16(Hand16);
Mem32 := PChar(WOWGetVDMPointer(Mem16, MemSize, True));
StrPCopy(Mem32, 'I REALLY love DDG!');
Result := WOWCallback16(CallBackFunc, Mem16);
WOWGlobalUnlockFree16(Mem16);
end;
exports
DLLFunc32 name 'DLLFunc32' resident;
begin
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -