޼ת˵
ļʽ̬ӿļʽ,ļ׺ӦΪ.dll
ʹ÷õļڱĿ¼У޼תȻ˵£ҵĿ
ֱӰйļɾƳĿ¼
ļݣҪṩԶ̵õĺ˵£

FuncName
һַ(ָ)ڷزƣƽʾڡ޼תĲ˵¡

AnsiFunction
һͨıַ(ָ)úڴıݣд󣬷ͻ򡣸úһ͵Ľжϴ
Ϊ0ʾҪѲصıʾ༭
Ϊ1ʾǲҪѲصıʾ༭򣬶ʾ״̬·ϢʾУһڷضıһЩ
Ϊ1ϵʾйг˴򽫲ԷصĲκδͬʱԻʾгصĳ
Աڱд߷ԭ

UnicFunction
˺ĹAnsiFunctionһһģĲһUNICODEַWideChar޼ת֧ANSIUNICODEııʽֱȽϴʱҪֱֱֿд򿪵һUNICODEı״̬ʾΪǰ:[unicode]ʱUnicFunctionAnsiFunction

Ķ̬ӿļӦҪڲִвʱܻᵼ³ϿɶֳԱд¾һDELPHIΪԱдӣ书ܼܺ򵥾ıһ"a"Ȥûԡ³DELPHI7Ѿͨ

////////////////////////////////////////////////////////////////
library plus1;

uses
  SysUtils,Classes;

{$R *.res}


function FuncName(var Name:Pchar):integer;stdcall;
begin
Name:=Pchar('Բ');
Result:=0;
end;

function AnsiFunction(var Src:Pchar):integer;stdcall;
var
s:string;
begin
Result:=2;         // >1
s:=Src;
if s='' then exit;
Result:=1;         // 1ɹ,طϢ
if s='1' then
  begin
  Src:=Pchar('AnsiOK');
  exit;
  end;
s:=Src+'A';
Src:=Pchar(s);     //ز
Result:=0;         // 0ɹ,زı
end;

function UnicFunction(var Src:PWideChar):integer;stdcall;
var
s:widestring;
begin
Result:=2;         // >1
s:=Src;
if length(Src)=0 then exit;
Result:=1;         // 1ɹ,طϢ
if s='1' then
  begin
  s:='UnicOK';
  Src:=PWidechar(s);
  exit;
  end;
s:=s+'a';
Src:=PWideChar(s); //ز
Result:=0;         // 0ɹ,زı
end;

exports
FuncName,AnsiFunction,UnicFunction;//Ϊ

begin
end.
////////////////////////////////////////////////////////////////

ȤѿԵµַұṩĲԭļ
