我想用 Delphi 编写包含函数的 Dll,然后在 Excel VBA 调用。试了很多次都无法返回正确的结果。
具体如下:
Delphi7 中的测试源码:
//********************************************************************************************
library XlsExt;
{比较两数的大小,并返回较大者}
uses
SysUtils,
Classes;
{$R *.res}
var
SaveExit:Pointer;
procedure LibExit; //为了不使退出Excel时出现异常
begin
ExitProc:=SaveExit; //恢复退出过程链表
end;
function MyMax(X,Y:SmallInt):SmallInt;stdcall; //定义函数
begin
try
if X>Y then MyMax:=X else MyMax:=Y;
except
MyMax:=333; //测试异常处理,可是好像没有看到这个结果。
end;
end;
exports //函数输出
MyMax;
begin
SaveExit:=ExitProc; //保存退出过程链表
ExitProc:=@LibExit; //设置LibExit为退出过程
相关问答:
delphi 写了一个ocx文件,
idhttp.post(url,inStream,reStream)发送数据, 发送的数据是文件。
JSP端应该如何接收发送来的数据
DELPHI 代码如下。
var
Source: ......
已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试
在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......
我在模块里自定义了一个函数:stradd()
可是在adoquery1.sql.add('select stradd(author) from book');
时提示stradd未定义...
这个问题有什么办法可以解决的吗? 非常感激!
(在A ......
delphi 函数:
function RB(A: longint): longint;
begin
Result := (A shr 24) or ((A shr 8) and $FF00) or ((A shl 8) and $FF0000) or (A shl 24);
end;
我转成C#:
& ......
我尝试一个 idhttp 访问网站链接的程序
在设置代理端口的时候出错
编译没有错误
就是在运行的时候 出现了
80 is not a valid integer value 的问题
我已经把 函数分类出来的 port 转换为 integer 了 ......