請問呼叫dll傳回的bool值該如何抓取 |
尚未結案
|
kochen
一般會員 發表:8 回覆:5 積分:2 註冊:2004-09-05 發送簡訊給我 |
這是我寫的dll檔
library Project1; { 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 classes9. 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,
Unit1 in 'Unit1.pas'; function a():string;
export; {宣告一個函數} begin
end;
exports
PCopyFile; // {$R *.RES} var
result: Boolean = False;
begin result := result;
exit; end. 以下是我滴程式
我有拉一個 TextBox 和一個 button
unit Unit2; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var FormF,ToF:String;
Form1: TForm1;
Procedure PCopyFile(FromFIleN,ToFIleN:String);far;
external 'Project1.dll' implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
var
re: integer;
bo: LongBool;
st : String;
begin
PCopyFile(FormF,ToF) ;
if( bo ) then
re := 10
Else
re := -20;
Edit1.Text := IntToStr(re);
exit;
end; end. 只是我想把 PCopyFile(FormF,ToF) ; 改成 bo:= PCopyFile(FormF,ToF) ;
這樣我就能判段是不是true或false值
PCopyFile(FormF,ToF) ;是我呼叫dll所寫的,他會開啟另一個程式出來 可是這樣寫會錯....能否請那位指點小弟我一下
感激不盡...
|
supman
尊榮會員 發表:29 回覆:770 積分:924 註冊:2002-04-22 發送簡訊給我 |
|
kochen
一般會員 發表:8 回覆:5 積分:2 註冊:2004-09-05 發送簡訊給我 |
|
supman
尊榮會員 發表:29 回覆:770 積分:924 註冊:2002-04-22 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |