zoukankan
html css js c++ java
delphi 中DLL的建立
Dll的创建与调用
File ->New->Other->Dll Wizard
DLL的创建
//可以将本代码复制粘贴到项目中 library Project1; uses SysUtils, Classes, Windows, Forms; {$R *.res} function Min(x,y:Integer):Integer;stdcall; begin if (x<y) then Result:=x else Result:=y; end; procedure MsgBox(Msg:string;Title:string;uType:LongInt=MB_OK);stdcall; begin Application.MessageBox(PAnsiChar(Msg),PAnsiChar(Title),uType); end; exports Min, MsgBox; begin end.
DLL的调用1
//将Project1.dll文件复制到本项目中 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; function Min(x,y:Integer):Integer;stdcall;external 'project1.dll'; procedure MsgBox(Msg:string;Title:string;uType:LongInt=MB_OK);stdcall;external 'project1.dll'; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(IntToStr(Min(3,2))); end; procedure TForm1.Button2Click(Sender: TObject); begin MsgBox('Hello','Tips',MB_OK+MB_ICONINFORMATION); end; end.
来自为知笔记(Wiz)
附件列表
查看全文
相关阅读:
STL——(4)deque
Windows Server服务器日常管理技巧
各种服务器伪静态配置方法
DedeCMS V5.7开启memcache缓存的方法配置说明
windows服务器下iis的性能优化 服务器
网站出现service unavailable的解决方法
【ThinkPHP框架学习 】(2) --- 后台管理系统如何用iframe点击左边右边局部刷新
【ThinkPHP框架学习 】(1) --- thinkphp 3.2.3 验证码验证使用教程分享
走着走着,已经到了玩不起的年龄 —— 致自己
PHP常用数组(Array)函数整理
原文地址:https://www.cnblogs.com/xe2011/p/3876090.html
最新文章
TreeMap按照value进行排序
今日Java——Cay Horstmann访谈
经典SQL语句大全
POJ2356 Find a multiple 抽屉原理(鸽巢原理)
Web编辑器的使用
MapReduce模型探究--总览
我给自己的新年礼物—书籍——2014002
Mysql错误:Duplicate entry '127' for key 'PRIMARY'的解决方法
很好用的php在线调试工具
文件系统的挂载(2)---挂载rootfs文件系统
热门文章
linux计划任务之crontab
第一部分——状态估计机理(1)-- 概率论基础
QT——(1)下载和安装
STL——(11)常用算法
STL——(10)函数对象(仿函数)
STL——(9)map/ multimap容器
STL——(8)set/ multiset 容器和pair对组
STL——(7)list容器
STL——(6)queue 容器
STL——(5)stack容器
Copyright © 2011-2022 走看看