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)
附件列表
查看全文
相关阅读:
selenium防止检测,修改chromedriver.exe
ElasticSearch笔记脚本(script)
Newtonsoft助手类
js单元测试,使用断言捕获抛出的异常
解决homebrew的权限问题
匹配驼峰命名、蛇形命名的正则表达式
supertest测试,expect不同的状态码,但都能通过
如何退出/关闭telnet终端
解决子模块的合并冲突
解决终端无法访问github.com 的错误
原文地址:https://www.cnblogs.com/xe2011/p/3876090.html
最新文章
4种基本光照模型
OpenCV 实现图像去阴影
Qt 显示16位图像
Qt 继承QWidget或者QWidget直接弹出窗口(非模态对话框)(对话框)
OpenCV 如何判断图片里某个颜色值占的比例
OpenCV imread()模式说明
Qt Error: dependent ‘.h‘ does not exist问题解决
Qt tiff的读写与显示
OpenCV 实现低对比度图像脏污区域检测
Qt QImage从内存中读取16位图片
热门文章
Ubuntu 设置双击运行sh脚本
OpenCV cvCreateImage函数说明
OpenCV cv::convertScaleAbs()使用详解
OpenCV 光照补偿和去除光照
linux安装sqlserver
win10、win7安装SQLServer2000最详细教程
咽炎终于要治好了——咽炎的治疗,个人贴
为什么矩阵的特征值乘积等于行列式的值
预训练模型finetune使用思路
Chrome禁止更新
Copyright © 2011-2022 走看看