易截截图软件、单文件、免安装、纯绿色、仅160KB

Excel 如何调用 Delphi 编译的 Dll 中的函数?

我想用 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为退出过程


相关问答:

需要把vb代码转成delphi或VC++的代码。

怎么实现dos下runas自动输入密码
http://bbs.pfan.cn/post-278076.html
代码如下:
VB code:

Option Explicit
Private Const LOGON_WITH_PROFILE = &H1&
Private Const CREATE_DEFAULT_ERRO ......

Python中的Unicode在Delphi如何还原成Gb2312?

已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试

在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......

delphi 与 C# 位运算 有好大区别,请教各位!

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#:

& ......

求 delphi webserivice 调用例子

求  delphi webserivice 调用例子
服务端编写:新建"WebServices-->SOAP Server Application-->ISAPI/NSAPI Dynamic Link Library","Service name"填写你要的服务名,如"SendS ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号