1、动态调用DLL

unit formMain;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TfrmMain = class(TForm)
btnLoadLibrary: TButton;
procedure btnLoadLibraryClick(Sender: TObject);
private
{ Private declarations }
public
procedure LoadDllZ;
end; TfnC_ExecJS = function(_pSvgFrm :Pointer; _pcJS :PChar):integer;stdcall;
TfnD_PassStId = function(_Sender :Pointer; _pcStId :PChar):integer;stdcall; var
frmMain: TfrmMain;
// ***
g_fnExecJS : TfnC_ExecJS;
g_fnPassStId :TfnD_PassStId; implementation {$R *.dfm} { TfrmMain } procedure TfrmMain.LoadDllZ;
var hDll :Cardinal;
iRtn :integer;
begin
hDll := LoadLibrary(PChar('DrRemoteCall.dll'));
if hDll = then
begin
Exit;
end; @g_fnExecJS := GetProcAddress(hDll, 'ExecJS');
@g_fnPassStId := GetProcAddress(hDll, 'PassStId'); if not Assigned( g_fnExecJS ) then
begin
FreeLibrary(hDll);
Exit;
end;
if not Assigned( g_fnPassStId ) then
begin
FreeLibrary(hDll);
Exit;
end; // ZC: 调用函数
iRtn := g_fnExecJS(nil, 'TestCC'); FreeLibrary(hDll);
ShowMessage('out');
end; procedure TfrmMain.btnLoadLibraryClick(Sender: TObject);
begin
LoadDllZ;
end; end.

2、

3、

4、

5、

最新文章

  1. Docker部署Hadoop集群
  2. JS(javascript) 将网站加入收藏夹
  3. [翻译]Bob大叔:反思极限编程
  4. Servlet-中文乱码
  5. [数据结构与算法]哈夫曼(Huffman)树与哈夫曼编码
  6. Java多线程——<一>概述、定义任务
  7. 如何用css3实现风车效果
  8. ios 工程配置统一增加类的前缀(知识点也只能算知识点)
  9. NFC手机
  10. SWOT自我分析
  11. Hibernate创建SessionFactory实例
  12. EasyNetQ WithTopic过滤失效的解决方案
  13. Python之旅.第二章数据类型 3.19/3.20/3.21/3.22/3.23
  14. SAP Hybris电子商务最新功能
  15. Redis集群中的节点如何保证数据一致
  16. Mac下Eclipse读取不到环境变量
  17. Putty的用法
  18. JS截取字符串方法实例
  19. django学习--1
  20. HDU - 1525

热门文章

  1. python常见模块之random模块
  2. java7(2)——使用mutilcatch注意事项
  3. PAT 1033 To Fill or Not to Fill[dp]
  4. genymotion——在虚拟机中当中安装genymotion,启动已经新增好的设备时,提示:the virtual device got no ip address
  5. 记录:正确率、召回率、F值
  6. python3 爬虫神器pyquery的使用实例之爬网站图片
  7. Portal系统中当切换学生时仍旧停留在当前页面的实现方法
  8. 002-jdk10安装
  9. 『NiFi 节点本地流与集群流不一致导致集群加入失败』问题解决
  10. Python之路——线程池