求帮助........

tigi 2005-03-01 08:55:43
请朋友帮我做个DLL文件。我现在需要一个DLL文件(类似于API),在PB中进行声明调用。

这个DLL文件中封装一个函数。函数的名字是JhaRdecrypt,返回值为BOOLEAN型。这个函数有两个参数,A和B,这两个参数都是String型的,其中,B为ref的参数(可以返回值)最后函数的返回值为TRUE
函数的内容如下:
B = A;//把A的值赋给B;
retrun True;//函数返回真
用VB语言描述为:
Function JhaRdecrypt(A As String, ByRef B As String) As Boolean
B = A
JhaRdecrypt = True
End Function
请朋友们帮我把这个做一下发到我的邮箱。
我的邮箱是gaoxianfengtigi@sina.com.cn
...全文
138 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
gzmhero 2005-03-01
  • 打赏
  • 举报
回复
again
tigi 2005-03-01
  • 打赏
  • 举报
回复
我没收到啊你在发一遍好吗?
gzmhero 2005-03-01
  • 打赏
  • 举报
回复
已经email给你。
gzmhero 2005-03-01
  • 打赏
  • 举报
回复
dll:
library comm;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
windows,
Classes;

{$R *.res}

function JhaRdecrypt(var A:string;var B:string):boolean;stdcall;
begin
B:=A;
Result:=true;
end;

exports
JhaRdecrypt;

begin
end.

使用DLL:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

function JhaRdecrypt(var A:string;var B:string):boolean;stdcall;external 'comm.dll';

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
A,B:string;
begin
A:=Edit1.Text;
JhaRdecrypt(A,B);
Edit2.Text:=B;
end;

end.
todouwang 2005-03-01
  • 打赏
  • 举报
回复
dll编写,http://blog.csdn.net/whbo

16,747

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧