关于编写DLL的问题.

wlk2002 2004-07-21 01:59:34
最近作一个项目, 需要用到DLL,我以前从未接写过DLL(只是听说过,了解一些基础知识),给为能不能介绍一些这方面的具体实例(小一点的就可以),或者给一些这方面的电子文档(最好有大量的实例)?我看了一点这方面的介绍,感觉就是没有一些基础的实例源码.谢谢!!
...全文
88 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhlwyy 2004-07-21
  • 打赏
  • 举报
回复
File--New--Others--DLL Wizard
给你一段最简单的daima
library Project2;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Classes;

{$R *.res}

function mytest(num1:integer):integer; stdcall;

begin
result:=num1;
end;

exports
add;

begin
end.
亲密数 2004-07-21
  • 打赏
  • 举报
回复
新建工程里面不就有一个dll wizard项目吗。

在项目文件中exports关键字下写下导出函数(包含)的名字。然后编译,build就可以生成dll文件了.

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧