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)
附件列表
查看全文
相关阅读:
Sublime Text 3 安装插件管理 Package Control
Sublime Text 2&3中输入法不跟随光标移动的问题的解决方法
Centos 7 yum 安装php
Centos 7 yum 安装Apache
正则验证多个邮箱用分号隔开
Linux下修改网卡IP、DNS和网关
mysqldump when doing LOCK TABLES问题
jQuery遍历json
Yii中CDbCriteria常用方法
Parse error: syntax error, unexpected T_PUBLIC in 问题解决
原文地址:https://www.cnblogs.com/xe2011/p/3876090.html
最新文章
DataTables VS EasyUI DataGrid 基础应用 转
webmagic的设计机制及原理-如何开发一个Java爬虫 转
groovy
XPath Checker 和 firebug 插件使用
suse linux 常用命令
mybatis-3 Dynamic SQL
java中元注解
Selenium WebDriver
spring + groovy 转
WebMagic 爬虫框架
热门文章
Java中getResourceAsStream的用法
hibernate SQL Error: 8152, SQLState: 22001
JAVA实现长连接(含心跳检测)Demo
Spring jndi数据源配置方法
[SSH]struts2-spring-plugin.jar了解
(转)最全正则表达式总结:验证QQ号、手机号、Email、中文、邮编、身份证、IP地址等
遇到问题-----cas4.2.x登录成功后报错No principal was found---cas中文乱码问题完美解决
Java多线程编程:Callable、Future和FutureTask浅析(多线程编程之四)
手把手教你Chrome浏览器安装Postman(含下载云盘链接)【转载】
开发者常用的十款Chrome插件
Copyright © 2011-2022 走看看