Exp=x
ModuleFileName=Function_1.pas
mgs=ע⣺ڱܹʱҪеSoftKey.pas,yt.objӵҪܵĹڵĿ¼С
Statement__Ini=procedure Ini;
Statement_f_ini_3=procedure Ini_3(W_HKey: string ; W_LKey: string );
Statement_f_CheckKey=function CheckKey_1: boolean;
Statement_f_YStrCat=function YStrCat_1(W_S1, W_S2: string ): string ;
Statement_f_YWideCompareText=function YWideCompareText_1(W_S1, W_S2: string ): integer;
Statement_f_YWideCompareStr=function YWideCompareStr_1(W_S1, W_S2: string ): integer;
Statement_f_YStrCopy=function YStrCopy_1(W_S: string ): string ;
Statement_f_YCompareVal=function YCompareVal_1(V1, V2: longint; Exp: ansiChar): boolean;
Statement_f_YSetValue=function YSetValue_1(V: longint): longint;
Statement_f_YAdd=function YAdd_1(V1, V2: longint): longint;
Statement_f_YDecrease=function YDecrease_1(V1, V2: longint): longint;
Statement_f_YMultiply=function YMultiply_1(V1, V2: longint): longint;
Statement_f_YDivide=function YDivide_1(V1, V2: longint): longint;
Statement_f_YAnd=function YAnd_1(V1, V2: boolean): boolean;
Statement_f_YOr=function YOr_1(V1, V2: boolean): boolean;
@end
                                        
unit @ytclass;
//´칤Զɣѡģ顱
interface

uses
//ע⣺ڱܹʱҪеSoftKey.pas,yt.objӵҪܵĹڵĿ¼
  Windows, SysUtils, Forms,SoftKeyPro;

//ԤϢ
const
  ErrorMessage257= 'Windows NT²ܴ򿪶˿ڣԭδװ򣬻װʧܡ룺-257';
  ErrorMessage201= 'ļڻ޷򿪼ļ룺-201';
  ErrorMessage203= '޷ȡļ룺-203';
  ErrorMessage204= '޷ȡļ룺-204';
  ErrorMessage213= 'ַܵȴ256޷תļ룺-213';
  ErrorMessage46= 'ĲΪգ룺-46';
  ErrorMessage2= 'ʧܣԭ޼汾ȷ룺-2';
  ErrorMessage92= 'ʧܣԭ޼汾ȷ룺-92';
  ErrorMessage1= '󣡷룺-1';


function GetErrorMessage(ErrorCode: integer): string ;

procedure ShowKeyMessage(ErrorCode:integer);

function GetKeyLastError: integer;

//*****ʹôɵĺӿ*****
procedure Ini;

$f_Ini_3$

$f_CheckKey$

$f_YStrCat$

$f_YWideCompareText$

$f_YWideCompareStr$

$f_YStrCopy$

$f_YCompareVal$

$f_YSetValue$

$f_YAdd$

$f_YDecrease$

$f_YMultiply$

$f_YDivide$

$f_YAnd$

$f_YOr$

implementation

var
  KeyPath: array[0..Max_Path] of ansiChar= ''; //ñڱڵ·ԱCal_2ĵ
  KeyLastError: integer= 0;  //ñڱһβ


//*****ΪһЩúʵ*****
function WideStringToAnsiString(const WideSource: WideString): AnsiString;
var
  WideStrLen: Integer;
begin
  if WideSource <> '' then
  begin
    WideStrLen := WideCharToMultiByte(0, 0, LPWSTR(WideSource), -1, nil, 0, nil, nil);
    if WideStrLen > 0 then
    begin
      SetLength(Result, WideStrLen - 1);
      WideCharToMultiByte(0, 0, LPWSTR(WideSource), -1, LPSTR(Result), WideStrLen, nil, nil);
    end;
  end;
end;

function AnsiStringToWideString(const AnsiSource: AnsiString): WideString;
var
  AnsiStrLen: Integer;
begin
  if AnsiSource <> '' then
  begin
    AnsiStrLen := MultiByteToWideChar(0, MB_PRECOMPOSED, LPSTR(AnsiSource), -1, nil, 0);
    if AnsiStrLen > 1 then
    begin
      SetLength(Result, AnsiStrLen - 1);
      MultiByteToWideChar(0, MB_PRECOMPOSED, LPSTR(AnsiSource), -1, LPWSTR(Result), AnsiStrLen - 1);
    end;
  end;
end;

//ݼķ룬شĺ
function GetErrorMessage(ErrorCode: integer): string ;
begin
  case ErrorCode of
   -257: Result:= ErrorMessage257;
   -201: Result:= ErrorMessage201;
   -203: Result:= ErrorMessage203;
   -204: Result:= ErrorMessage204;
   -213: Result:= ErrorMessage213;
    -46: Result:= ErrorMessage46;
    -92: Result:= ErrorMessage92;
     -2: Result:= ErrorMessage2;
     -1: Result:= ErrorMessage1;
  else
    Result:= 'ʱϵ룺'+ IntToStr(ErrorCode);
  end;
end;

//GetKeyLastErrorʱúʾĴϢʾ
procedure ShowKeyMessage(ErrorCode:integer);
begin
  Application.MessageBox(pchar(GetErrorMessage(ErrorCode)), '', 48);
end;

//ȡһβķ룬úزʱ
//GetErrorMessage(ErrorCode: integer): ansistring ;ɻô뺬壬
//ShowKeyMessage(ErrorCode:integer);ʾĴϢʾ
function GetKeyLastError: integer;
begin
  Result:= KeyLastError;
end;


//*****Ϊܺʵ*****
#f_Ini#

#f_ini_3#

#f_CheckKey#

#f_YStrCat#

#f_YWideCompareText#

#f_YWideCompareStr#

#f_YStrCopy#

#f_YCompareVal#

#f_YSetValue#

#f_YAdd#

#f_YDecrease#

#f_YMultiply#

#f_YDivide#

#f_YAnd#

#f_YOr#

end.