随笔分类 -  DLL 相关

Dll 使用 PChar 参数的小例子 - 回复 "linximf" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/12/20/985931.html#1408308 本例效果图: Dll 文件: library Lib; uses SysUtils, Classes; {$R *.res} procedure Test(p: PChar); const Title = 'Title '; var ... 阅读全文
posted @ 2008-12-20 22:44 万一 阅读(10826) 评论(38) 推荐(1) 编辑
学习使用资源文件[11] - DLL 中的资源文件
摘要:本例将把一张 bmp 图片, 以资源文件的方式嵌入 dll, 然后再调用. 第一步: 建一个 DLL 工程, 如图: 然后保存, 我这里使用的名称都是默认的. 第二步: 建一个资源原文件, 如图: 编辑内容如下(路径中的文件一定要存在): img1 BITMAP "c:\temp\test.bmp" 然后, 取个名(后缀须是 rc, 我这里取名为 Res.rc), 保存在工程目录... 阅读全文
posted @ 2008-02-15 16:11 万一 阅读(15283) 评论(30) 推荐(0) 编辑
创建并调用 DLL(1)
摘要://通过 DLL Wizard 建立: library TestDLL; uses SysUtils, Classes, Dialogs; {$R *.res} //建立过程 procedure Test; begin ShowMessage('TestDLL.Test'); end; //输出 exports Test; begin end. //在其他工程调... 阅读全文
posted @ 2007-12-07 00:05 万一 阅读(13413) 评论(31) 推荐(1) 编辑
调用外部 DLL 中的函数(2. 晚绑定)
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type //晚绑定,也就是动态调用外部函数主要用以下三个命令: //LoadLibrary:获取 DLL //GetProcAd... 阅读全文
posted @ 2007-12-06 22:13 万一 阅读(12977) 评论(35) 推荐(2) 编辑
调用外部 DLL 中的函数(1. 早绑定)
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button... 阅读全文
posted @ 2007-12-06 21:37 万一 阅读(13791) 评论(53) 推荐(3) 编辑