怪哉,我一直这么用的,突然不行了.(100分)

X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!

用友U8产品,我调它的login,一直采用以下方法:

VB:

Dim Uflogin as new ufLoginSQL.login
'813/820/821(850用U8login.clslogin)

if Uflogin.login('DP') then
...
MsgBox "调用成功!'
Else
MsgBox "调用失败!'
EndIF


Delphi:
Uses Comobj...;
proc ...
Var Uflogin:Variant;
begin
uflogin:=createOleObject('ufLoginSQl.login')
'813/820/821 (850用U8Login.clsLogin)
if Uflogin.login('DP') then
Begin
...
MessageBox(handle,"调用成功!",'OK:'+mb_ok);
End
Else
MessageBox(handle,"调用失败!",'Error:'+mb_ok);
...

End.

我一直这么用的,没出什么问题,去年11月发的850一直可以连,可新的U8一出来,Delphi连不上了,
永远执行 Else 后边的"调用失败!"(VB却可以)

哪位大虾指点一下.

我Import Type Library 后得到了U8login_tlb.pas 却不知该如何调其Login方法.







 

晕了晕了

Unregistered / Unconfirmed
GUEST, unregistred user!

小熊跳舞

Unregistered / Unconfirmed
GUEST, unregistred user!
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
我贴个U8login_tlb出来,谁帮我一下,我怎么去调它的Login函数。

unit U8Login_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// PASTLWTR : $Revision: 1.88.1.0.1.0 $
// File generated on 2003-04-10 14:04:19 from Type Library described below.

// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
// ************************************************************************ //
// Type Lib: C:/WINNT/System32/UFCOMSQL/U8Login.dll (1)
// IID/LCID: {B791AEA7-739C-48B7-AD29-D70B1C36A30F}/0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (C:/WINNT/System32/STDOLE2.TLB)
// (2) v2.6 ADODB, (C:/Program Files/Common Files/System/ADO/msado26.tlb)
// (3) v4.0 StdVCL, (C:/WINNT/System32/STDVCL40.DLL)
// Errors:
// Error creating palette bitmap of (TclsLogin) : Server C:/WINNT/System32/UFCOMSQL/U8Login.dll contains no icons
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface

uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL,
ADODB_TLB;

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
U8LoginMajorVersion = 1;
U8LoginMinorVersion = 5;

LIBID_U8Login: TGUID = '{B791AEA7-739C-48B7-AD29-D70B1C36A30F}';

IID__clsLogin: TGUID = '{263B82CB-C6D5-4037-A295-2A861DA30B92}';
CLASS_clsLogin: TGUID = '{72A6FADA-FE26-46BD-A921-BFD1179C1E1E}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_clsLogin = interface;
_clsLoginDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
clsLogin = _clsLogin;


// *********************************************************************//
// Declaration of structures, unions and aliases.
// *********************************************************************//

clsLogin___v0 = _clsLogin

clsLogin___v1 = _clsLogin

clsLogin___v2 = _clsLogin

clsLogin___v3 = _clsLogin

clsLogin___v4 = _clsLogin


// *********************************************************************//
// Interface: _clsLogin
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {263B82CB-C6D5-4037-A295-2A861DA30B92}
// *********************************************************************//
_clsLogin = interface(IDispatch)
['{263B82CB-C6D5-4037-A295-2A861DA30B92}']
function Get_AuthString: WideString
safecall;
procedure Set_AuthString(const Param1: WideString)
safecall;
procedure Set_cWebClient(const Param1: WideString)
safecall;
function Get_cServer: OleVariant
safecall;
procedure Set_cServer(Param1: OleVariant)
safecall;
procedure GhostMethod_40
safecall;
procedure GhostMethod_44
safecall;
procedure GhostMethod_48
safecall;
procedure GhostMethod_52
safecall;
procedure GhostMethod_56
safecall;
procedure GhostMethod_60
safecall;
procedure GhostMethod_64
safecall;
procedure GhostMethod_68
safecall;
procedure GhostMethod_72
safecall;
procedure GhostMethod_76
safecall;
procedure GhostMethod_80
safecall;
procedure GhostMethod_84
safecall;
procedure GhostMethod_88
safecall;
procedure GhostMethod_92
safecall;
procedure GhostMethod_96
safecall;
procedure GhostMethod_100
safecall;
procedure GhostMethod_104
safecall;
procedure GhostMethod_108
safecall;
procedure GhostMethod_112
safecall;
procedure GhostMethod_116
safecall;
procedure GhostMethod_120
safecall;
procedure GhostMethod_124
safecall;
procedure GhostMethod_128
safecall;
procedure GhostMethod_132
safecall;
procedure GhostMethod_136
safecall;
procedure GhostMethod_140
safecall;
procedure GhostMethod_144
safecall;
procedure GhostMethod_148
safecall;
procedure GhostMethod_152
safecall;
procedure GhostMethod_156
safecall;
procedure GhostMethod_160
safecall;
procedure GhostMethod_164
safecall;
procedure GhostMethod_168
safecall;
function Get_cSerial: OleVariant
safecall;
procedure Set_cSerial(Param1: OleVariant)
safecall;
procedure GhostMethod_180
safecall;
procedure GhostMethod_184
safecall;
function Get_cServerSerial: OleVariant
safecall;
function Get_cDbServerSerial: OleVariant
safecall;
function RemoteExec(var cCmd: WideString): OleVariant
safecall;
function Get_LanguageID: Integer
safecall;
function Get_cUserPassWord: WideString
safecall;
function Get_UfSystemDb: IDispatch
safecall;
function Get_LogState: Integer
safecall;
function Get_ShareString: WideString
safecall;
function Get_SysPassword: WideString
safecall;
function Get_cSubName: WideString
safecall;
function Get_cAcc_Id: WideString
safecall;
procedure Set_cAcc_Id(var Param1: WideString)
safecall;
function Get_cAccName: WideString
safecall;
function Get_CurDate: TDateTime
safecall;
function Get_cIYear: WideString
safecall;
function Get_iMonth: Smallint
safecall;
function Get_cUserId: WideString
safecall;
function Get_cUserName: WideString
safecall;
function Get_UfDbName: WideString
safecall;
function Get_UfDbPath: WideString
safecall;
function Get_UfZtPath: WideString
safecall;
function Get_IsAdmin: WordBool
safecall;
function Get_TaskId: WideString
safecall;
procedure ClearError
safecall;
function GetNatureDate(var iPeriod: Smallint
var dateBegin: TDateTime
var dateEnd: TDateTime): Integer
safecall;
function GetPeriod(dCurDate: TDateTime
var iYear: Smallint
var iPeriod: Smallint): Integer
safecall;
function Login(var pSubId: WideString
var pAccId: WideString
var pYearId: WideString

var pUserId: WideString
var pPassword: WideString
var pDate: WideString

var cSrv: WideString
var cSerial: WideString): WordBool
safecall;
function TaskExec(const pAuth_id: WideString
bIsLock: Smallint
iYear: Smallint): WordBool
safecall;
function ClosingStatus(nIndex: Smallint
const cSubId: WideString
iYear: Smallint

var bStateValue: WordBool): WordBool
safecall;
function GetAccInfo(nIndex: Integer
var vValue: OleVariant): WordBool
safecall;
procedure ShutDown
safecall;
function FD_Month_Used(var dbszj: _Connection): Smallint
safecall;
function CADemoMonth(var dbs: _Connection): Smallint
safecall;
function IAMonthHandled(var ObjDatabase: _Connection): Smallint
safecall;
function GetIstallPath: WideString
safecall;
property AuthString: WideString read Get_AuthString write Set_AuthString;
property cWebClient: WideString write Set_cWebClient;
property cServer: OleVariant read Get_cServer write Set_cServer;
property cSerial: OleVariant read Get_cSerial write Set_cSerial;
property cServerSerial: OleVariant read Get_cServerSerial;
property cDbServerSerial: OleVariant read Get_cDbServerSerial;
property LanguageID: Integer read Get_LanguageID;
property cUserPassWord: WideString read Get_cUserPassWord;
property UfSystemDb: IDispatch read Get_UfSystemDb;
property LogState: Integer read Get_LogState;
property ShareString: WideString read Get_ShareString;
property SysPassword: WideString read Get_SysPassword;
property cSubName: WideString read Get_cSubName;
property cAcc_Id: WideString read Get_cAcc_Id write Set_cAcc_Id;
property cAccName: WideString read Get_cAccName;
property CurDate: TDateTime read Get_CurDate;
property cIYear: WideString read Get_cIYear;
property iMonth: Smallint read Get_iMonth;
property cUserId: WideString read Get_cUserId;
property cUserName: WideString read Get_cUserName;
property UfDbName: WideString read Get_UfDbName;
property UfDbPath: WideString read Get_UfDbPath;
property UfZtPath: WideString read Get_UfZtPath;
property IsAdmin: WordBool read Get_IsAdmin;
property TaskId: WideString read Get_TaskId;
end;

// *********************************************************************//
// DispIntf: _clsLoginDisp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {263B82CB-C6D5-4037-A295-2A861DA30B92}
// *********************************************************************//
_clsLoginDisp = dispinterface
['{263B82CB-C6D5-4037-A295-2A861DA30B92}']
property AuthString: WideString dispid 1745027133;
property cWebClient: WideString writeonly dispid 1745027093;
property cServer: OleVariant dispid 1745027092;
procedure GhostMethod_40
dispid 1610743813;
procedure GhostMethod_44
dispid 1610743814;
procedure GhostMethod_48
dispid 1610743815;
procedure GhostMethod_52
dispid 1610743816;
procedure GhostMethod_56
dispid 1610743817;
procedure GhostMethod_60
dispid 1610743818;
procedure GhostMethod_64
dispid 1610743819;
procedure GhostMethod_68
dispid 1610743820;
procedure GhostMethod_72
dispid 1610743821;
procedure GhostMethod_76
dispid 1610743822;
procedure GhostMethod_80
dispid 1610743823;
procedure GhostMethod_84
dispid 1610743824;
procedure GhostMethod_88
dispid 1610743825;
procedure GhostMethod_92
dispid 1610743826;
procedure GhostMethod_96
dispid 1610743827;
procedure GhostMethod_100
dispid 1610743828;
procedure GhostMethod_104
dispid 1610743829;
procedure GhostMethod_108
dispid 1610743830;
procedure GhostMethod_112
dispid 1610743831;
procedure GhostMethod_116
dispid 1610743832;
procedure GhostMethod_120
dispid 1610743833;
procedure GhostMethod_124
dispid 1610743834;
procedure GhostMethod_128
dispid 1610743835;
procedure GhostMethod_132
dispid 1610743836;
procedure GhostMethod_136
dispid 1610743837;
procedure GhostMethod_140
dispid 1610743838;
procedure GhostMethod_144
dispid 1610743839;
procedure GhostMethod_148
dispid 1610743840;
procedure GhostMethod_152
dispid 1610743841;
procedure GhostMethod_156
dispid 1610743842;
procedure GhostMethod_160
dispid 1610743843;
procedure GhostMethod_164
dispid 1610743844;
procedure GhostMethod_168
dispid 1610743845;
property cSerial: OleVariant dispid 1745027131;
procedure GhostMethod_180
dispid 1610743848;
procedure GhostMethod_184
dispid 1610743849;
property cServerSerial: OleVariant readonly dispid 1745027135;
property cDbServerSerial: OleVariant readonly dispid 1745027137;
function RemoteExec(var cCmd: WideString): OleVariant
dispid 1610809366;
property LanguageID: Integer readonly dispid 1745027091;
property cUserPassWord: WideString readonly dispid 1745027090;
property UfSystemDb: IDispatch readonly dispid 1745027089;
property LogState: Integer readonly dispid 1745027088;
property ShareString: WideString readonly dispid 1745027087;
property SysPassword: WideString readonly dispid 1745027086;
property cSubName: WideString readonly dispid 1745027084;
property cAcc_Id: WideString dispid 1745027083;
property cAccName: WideString readonly dispid 1745027082;
property CurDate: TDateTime readonly dispid 1745027081;
property cIYear: WideString readonly dispid 1745027080;
property iMonth: Smallint readonly dispid 1745027079;
property cUserId: WideString readonly dispid 1745027078;
property cUserName: WideString readonly dispid 1745027077;
property UfDbName: WideString readonly dispid 1745027076;
property UfDbPath: WideString readonly dispid 1745027075;
property UfZtPath: WideString readonly dispid 1745027074;
property IsAdmin: WordBool readonly dispid 1745027073;
property TaskId: WideString readonly dispid 1745027072;
procedure ClearError
dispid 1610809367;
function GetNatureDate(var iPeriod: Smallint
var dateBegin: TDateTime
var dateEnd: TDateTime): Integer
dispid 1610809368;
function GetPeriod(dCurDate: TDateTime
var iYear: Smallint
var iPeriod: Smallint): Integer
dispid 1610809369;
function Login(var pSubId: WideString
var pAccId: WideString
var pYearId: WideString

var pUserId: WideString
var pPassword: WideString
var pDate: WideString

var cSrv: WideString
var cSerial: WideString): WordBool
dispid 1610809371;
function TaskExec(const pAuth_id: WideString
bIsLock: Smallint
iYear: Smallint): WordBool
dispid 1610809372;
function ClosingStatus(nIndex: Smallint
const cSubId: WideString
iYear: Smallint

var bStateValue: WordBool): WordBool
dispid 1610809373;
function GetAccInfo(nIndex: Integer
var vValue: OleVariant): WordBool
dispid 1610809374;
procedure ShutDown
dispid 1610809375;
function FD_Month_Used(var dbszj: _Connection): Smallint
dispid 1610809383;
function CADemoMonth(var dbs: _Connection): Smallint
dispid 1610809385;
function IAMonthHandled(var ObjDatabase: _Connection): Smallint
dispid 1610809388;
function GetIstallPath: WideString
dispid 1610809401;
end;

// *********************************************************************//
// The Class CoclsLogin provides a Create and CreateRemote method to
// create instances of the default interface _clsLogin exposed by
// the CoClass clsLogin. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoclsLogin = class
class function Create: _clsLogin;
class function CreateRemote(const MachineName: string): _clsLogin;
end;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TclsLogin
// Help String :
// Default Interface: _clsLogin
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TclsLoginProperties= class;
{$ENDIF}
TclsLogin = class(TOleServer)
private
FIntf: _clsLogin;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TclsLoginProperties;
function GetServerProperties: TclsLoginProperties;
{$ENDIF}
function GetDefaultInterface: _clsLogin;
protected
procedure InitServerData
override;
function Get_AuthString: WideString;
procedure Set_AuthString(const Param1: WideString);
procedure Set_cWebClient(const Param1: WideString);
function Get_cServer: OleVariant;
procedure Set_cServer(Param1: OleVariant);
function Get_cSerial: OleVariant;
procedure Set_cSerial(Param1: OleVariant);
function Get_cServerSerial: OleVariant;
function Get_cDbServerSerial: OleVariant;
function Get_LanguageID: Integer;
function Get_cUserPassWord: WideString;
function Get_UfSystemDb: IDispatch;
function Get_LogState: Integer;
function Get_ShareString: WideString;
function Get_SysPassword: WideString;
function Get_cSubName: WideString;
function Get_cAcc_Id: WideString;
procedure Set_cAcc_Id(var Param1: WideString);
function Get_cAccName: WideString;
function Get_CurDate: TDateTime;
function Get_cIYear: WideString;
function Get_iMonth: Smallint;
function Get_cUserId: WideString;
function Get_cUserName: WideString;
function Get_UfDbName: WideString;
function Get_UfDbPath: WideString;
function Get_UfZtPath: WideString;
function Get_IsAdmin: WordBool;
function Get_TaskId: WideString;
public
constructor Create(AOwner: TComponent)
override;
destructor Destroy
override;
procedure Connect
override;
procedure ConnectTo(svrIntf: _clsLogin);
procedure Disconnect
override;
procedure GhostMethod_40;
procedure GhostMethod_44;
procedure GhostMethod_48;
procedure GhostMethod_52;
procedure GhostMethod_56;
procedure GhostMethod_60;
procedure GhostMethod_64;
procedure GhostMethod_68;
procedure GhostMethod_72;
procedure GhostMethod_76;
procedure GhostMethod_80;
procedure GhostMethod_84;
procedure GhostMethod_88;
procedure GhostMethod_92;
procedure GhostMethod_96;
procedure GhostMethod_100;
procedure GhostMethod_104;
procedure GhostMethod_108;
procedure GhostMethod_112;
procedure GhostMethod_116;
procedure GhostMethod_120;
procedure GhostMethod_124;
procedure GhostMethod_128;
procedure GhostMethod_132;
procedure GhostMethod_136;
procedure GhostMethod_140;
procedure GhostMethod_144;
procedure GhostMethod_148;
procedure GhostMethod_152;
procedure GhostMethod_156;
procedure GhostMethod_160;
procedure GhostMethod_164;
procedure GhostMethod_168;
procedure GhostMethod_180;
procedure GhostMethod_184;
function RemoteExec(var cCmd: WideString): OleVariant;
procedure ClearError;
function GetNatureDate(var iPeriod: Smallint
var dateBegin: TDateTime
var dateEnd: TDateTime): Integer;
function GetPeriod(dCurDate: TDateTime
var iYear: Smallint
var iPeriod: Smallint): Integer;
function Login(var pSubId: WideString
var pAccId: WideString
var pYearId: WideString

var pUserId: WideString
var pPassword: WideString
var pDate: WideString

var cSrv: WideString
var cSerial: WideString): WordBool;
function TaskExec(const pAuth_id: WideString
bIsLock: Smallint
iYear: Smallint): WordBool;
function ClosingStatus(nIndex: Smallint
const cSubId: WideString
iYear: Smallint

var bStateValue: WordBool): WordBool;
function GetAccInfo(nIndex: Integer
var vValue: OleVariant): WordBool;
procedure ShutDown;
function FD_Month_Used(var dbszj: _Connection): Smallint;
function CADemoMonth(var dbs: _Connection): Smallint;
function IAMonthHandled(var ObjDatabase: _Connection): Smallint;
function GetIstallPath: WideString;
property DefaultInterface: _clsLogin read GetDefaultInterface;
property cWebClient: WideString write Set_cWebClient;
property cServer: OleVariant read Get_cServer write Set_cServer;
property cSerial: OleVariant read Get_cSerial write Set_cSerial;
property cServerSerial: OleVariant read Get_cServerSerial;
property cDbServerSerial: OleVariant read Get_cDbServerSerial;
property LanguageID: Integer read Get_LanguageID;
property cUserPassWord: WideString read Get_cUserPassWord;
property UfSystemDb: IDispatch read Get_UfSystemDb;
property LogState: Integer read Get_LogState;
property ShareString: WideString read Get_ShareString;
property SysPassword: WideString read Get_SysPassword;
property cSubName: WideString read Get_cSubName;
property cAccName: WideString read Get_cAccName;
property CurDate: TDateTime read Get_CurDate;
property cIYear: WideString read Get_cIYear;
property iMonth: Smallint read Get_iMonth;
property cUserId: WideString read Get_cUserId;
property cUserName: WideString read Get_cUserName;
property UfDbName: WideString read Get_UfDbName;
property UfDbPath: WideString read Get_UfDbPath;
property UfZtPath: WideString read Get_UfZtPath;
property IsAdmin: WordBool read Get_IsAdmin;
property TaskId: WideString read Get_TaskId;
property AuthString: WideString read Get_AuthString write Set_AuthString;
property cAcc_Id: WideString read Get_cAcc_Id write Set_cAcc_Id;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TclsLoginProperties read GetServerProperties;
{$ENDIF}
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TclsLogin
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TclsLoginProperties = class(TPersistent)
private
FServer: TclsLogin;
function GetDefaultInterface: _clsLogin;
constructor Create(AServer: TclsLogin);
protected
function Get_AuthString: WideString;
procedure Set_AuthString(const Param1: WideString);
procedure Set_cWebClient(const Param1: WideString);
function Get_cServer: OleVariant;
procedure Set_cServer(Param1: OleVariant);
function Get_cSerial: OleVariant;
procedure Set_cSerial(Param1: OleVariant);
function Get_cServerSerial: OleVariant;
function Get_cDbServerSerial: OleVariant;
function Get_LanguageID: Integer;
function Get_cUserPassWord: WideString;
function Get_UfSystemDb: IDispatch;
function Get_LogState: Integer;
function Get_ShareString: WideString;
function Get_SysPassword: WideString;
function Get_cSubName: WideString;
function Get_cAcc_Id: WideString;
procedure Set_cAcc_Id(var Param1: WideString);
function Get_cAccName: WideString;
function Get_CurDate: TDateTime;
function Get_cIYear: WideString;
function Get_iMonth: Smallint;
function Get_cUserId: WideString;
function Get_cUserName: WideString;
function Get_UfDbName: WideString;
function Get_UfDbPath: WideString;
function Get_UfZtPath: WideString;
function Get_IsAdmin: WordBool;
function Get_TaskId: WideString;
public
property DefaultInterface: _clsLogin read GetDefaultInterface;
published
property AuthString: WideString read Get_AuthString write Set_AuthString;
property cAcc_Id: WideString read Get_cAcc_Id write Set_cAcc_Id;
end;
{$ENDIF}


procedure Register;

implementation

uses ComObj;

class function CoclsLogin.Create: _clsLogin;
begin
Result := CreateComObject(CLASS_clsLogin) as _clsLogin;
end;

class function CoclsLogin.CreateRemote(const MachineName: string): _clsLogin;
begin
Result := CreateRemoteComObject(MachineName, CLASS_clsLogin) as _clsLogin;
end;

procedure TclsLogin.InitServerData;
const
CServerData: TServerData = (
ClassID: '{72A6FADA-FE26-46BD-A921-BFD1179C1E1E}';
IntfIID: '{263B82CB-C6D5-4037-A295-2A861DA30B92}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;

procedure TclsLogin.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as _clsLogin;
end;
end;

procedure TclsLogin.ConnectTo(svrIntf: _clsLogin);
begin
Disconnect;
FIntf := svrIntf;
end;

procedure TclsLogin.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;

function TclsLogin.GetDefaultInterface: _clsLogin;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;

constructor TclsLogin.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TclsLoginProperties.Create(Self);
{$ENDIF}
end;

destructor TclsLogin.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TclsLogin.GetServerProperties: TclsLoginProperties;
begin
Result := FProps;
end;
{$ENDIF}

function TclsLogin.Get_AuthString: WideString;
begin
Result := DefaultInterface.Get_AuthString;
end;

procedure TclsLogin.Set_AuthString(const Param1: WideString);
begin
DefaultInterface.Set_AuthString(Param1);
end;

procedure TclsLogin.Set_cWebClient(const Param1: WideString);
begin
DefaultInterface.Set_cWebClient(Param1);
end;

function TclsLogin.Get_cServer: OleVariant;
begin
Result := DefaultInterface.Get_cServer;
end;

procedure TclsLogin.Set_cServer(Param1: OleVariant);
begin
DefaultInterface.Set_cServer(Param1);
end;

function TclsLogin.Get_cSerial: OleVariant;
begin
Result := DefaultInterface.Get_cSerial;
end;

procedure TclsLogin.Set_cSerial(Param1: OleVariant);
begin
DefaultInterface.Set_cSerial(Param1);
end;

function TclsLogin.Get_cServerSerial: OleVariant;
begin
Result := DefaultInterface.Get_cServerSerial;
end;

function TclsLogin.Get_cDbServerSerial: OleVariant;
begin
Result := DefaultInterface.Get_cDbServerSerial;
end;

function TclsLogin.Get_LanguageID: Integer;
begin
Result := DefaultInterface.Get_LanguageID;
end;

function TclsLogin.Get_cUserPassWord: WideString;
begin
Result := DefaultInterface.Get_cUserPassWord;
end;

function TclsLogin.Get_UfSystemDb: IDispatch;
begin
Result := DefaultInterface.Get_UfSystemDb;
end;

function TclsLogin.Get_LogState: Integer;
begin
Result := DefaultInterface.Get_LogState;
end;

function TclsLogin.Get_ShareString: WideString;
begin
Result := DefaultInterface.Get_ShareString;
end;

function TclsLogin.Get_SysPassword: WideString;
begin
Result := DefaultInterface.Get_SysPassword;
end;

function TclsLogin.Get_cSubName: WideString;
begin
Result := DefaultInterface.Get_cSubName;
end;

function TclsLogin.Get_cAcc_Id: WideString;
begin
Result := DefaultInterface.Get_cAcc_Id;
end;

procedure TclsLogin.Set_cAcc_Id(var Param1: WideString);
begin
DefaultInterface.Set_cAcc_Id(Param1);
end;

function TclsLogin.Get_cAccName: WideString;
begin
Result := DefaultInterface.Get_cAccName;
end;

function TclsLogin.Get_CurDate: TDateTime;
begin
Result := DefaultInterface.Get_CurDate;
end;

function TclsLogin.Get_cIYear: WideString;
begin
Result := DefaultInterface.Get_cIYear;
end;

function TclsLogin.Get_iMonth: Smallint;
begin
Result := DefaultInterface.Get_iMonth;
end;

function TclsLogin.Get_cUserId: WideString;
begin
Result := DefaultInterface.Get_cUserId;
end;

function TclsLogin.Get_cUserName: WideString;
begin
Result := DefaultInterface.Get_cUserName;
end;

function TclsLogin.Get_UfDbName: WideString;
begin
Result := DefaultInterface.Get_UfDbName;
end;

function TclsLogin.Get_UfDbPath: WideString;
begin
Result := DefaultInterface.Get_UfDbPath;
end;

function TclsLogin.Get_UfZtPath: WideString;
begin
Result := DefaultInterface.Get_UfZtPath;
end;

function TclsLogin.Get_IsAdmin: WordBool;
begin
Result := DefaultInterface.Get_IsAdmin;
end;

function TclsLogin.Get_TaskId: WideString;
begin
Result := DefaultInterface.Get_TaskId;
end;

procedure TclsLogin.GhostMethod_40;
begin
DefaultInterface.GhostMethod_40;
end;

procedure TclsLogin.GhostMethod_44;
begin
DefaultInterface.GhostMethod_44;
end;

procedure TclsLogin.GhostMethod_48;
begin
DefaultInterface.GhostMethod_48;
end;

procedure TclsLogin.GhostMethod_52;
begin
DefaultInterface.GhostMethod_52;
end;

procedure TclsLogin.GhostMethod_56;
begin
DefaultInterface.GhostMethod_56;
end;

procedure TclsLogin.GhostMethod_60;
begin
DefaultInterface.GhostMethod_60;
end;

procedure TclsLogin.GhostMethod_64;
begin
DefaultInterface.GhostMethod_64;
end;

procedure TclsLogin.GhostMethod_68;
begin
DefaultInterface.GhostMethod_68;
end;

procedure TclsLogin.GhostMethod_72;
begin
DefaultInterface.GhostMethod_72;
end;

procedure TclsLogin.GhostMethod_76;
begin
DefaultInterface.GhostMethod_76;
end;

procedure TclsLogin.GhostMethod_80;
begin
DefaultInterface.GhostMethod_80;
end;

procedure TclsLogin.GhostMethod_84;
begin
DefaultInterface.GhostMethod_84;
end;

procedure TclsLogin.GhostMethod_88;
begin
DefaultInterface.GhostMethod_88;
end;

procedure TclsLogin.GhostMethod_92;
begin
DefaultInterface.GhostMethod_92;
end;

procedure TclsLogin.GhostMethod_96;
begin
DefaultInterface.GhostMethod_96;
end;

procedure TclsLogin.GhostMethod_100;
begin
DefaultInterface.GhostMethod_100;
end;

procedure TclsLogin.GhostMethod_104;
begin
DefaultInterface.GhostMethod_104;
end;

procedure TclsLogin.GhostMethod_108;
begin
DefaultInterface.GhostMethod_108;
end;

procedure TclsLogin.GhostMethod_112;
begin
DefaultInterface.GhostMethod_112;
end;

procedure TclsLogin.GhostMethod_116;
begin
DefaultInterface.GhostMethod_116;
end;

procedure TclsLogin.GhostMethod_120;
begin
DefaultInterface.GhostMethod_120;
end;

procedure TclsLogin.GhostMethod_124;
begin
DefaultInterface.GhostMethod_124;
end;

procedure TclsLogin.GhostMethod_128;
begin
DefaultInterface.GhostMethod_128;
end;

procedure TclsLogin.GhostMethod_132;
begin
DefaultInterface.GhostMethod_132;
end;

procedure TclsLogin.GhostMethod_136;
begin
DefaultInterface.GhostMethod_136;
end;

procedure TclsLogin.GhostMethod_140;
begin
DefaultInterface.GhostMethod_140;
end;

procedure TclsLogin.GhostMethod_144;
begin
DefaultInterface.GhostMethod_144;
end;

procedure TclsLogin.GhostMethod_148;
begin
DefaultInterface.GhostMethod_148;
end;

procedure TclsLogin.GhostMethod_152;
begin
DefaultInterface.GhostMethod_152;
end;

procedure TclsLogin.GhostMethod_156;
begin
DefaultInterface.GhostMethod_156;
end;

procedure TclsLogin.GhostMethod_160;
begin
DefaultInterface.GhostMethod_160;
end;

procedure TclsLogin.GhostMethod_164;
begin
DefaultInterface.GhostMethod_164;
end;

procedure TclsLogin.GhostMethod_168;
begin
DefaultInterface.GhostMethod_168;
end;

procedure TclsLogin.GhostMethod_180;
begin
DefaultInterface.GhostMethod_180;
end;

procedure TclsLogin.GhostMethod_184;
begin
DefaultInterface.GhostMethod_184;
end;

function TclsLogin.RemoteExec(var cCmd: WideString): OleVariant;
begin
Result := DefaultInterface.RemoteExec(cCmd);
end;

procedure TclsLogin.ClearError;
begin
DefaultInterface.ClearError;
end;

function TclsLogin.GetNatureDate(var iPeriod: Smallint
var dateBegin: TDateTime

var dateEnd: TDateTime): Integer;
begin
Result := DefaultInterface.GetNatureDate(iPeriod, dateBegin, dateEnd);
end;

function TclsLogin.GetPeriod(dCurDate: TDateTime
var iYear: Smallint
var iPeriod: Smallint): Integer;
begin
Result := DefaultInterface.GetPeriod(dCurDate, iYear, iPeriod);
end;

function TclsLogin.Login(var pSubId: WideString
var pAccId: WideString
var pYearId: WideString

var pUserId: WideString
var pPassword: WideString

var pDate: WideString
var cSrv: WideString
var cSerial: WideString): WordBool;
begin
Result := DefaultInterface.Login(pSubId, pAccId, pYearId, pUserId, pPassword, pDate, cSrv, cSerial);
end;

function TclsLogin.TaskExec(const pAuth_id: WideString
bIsLock: Smallint
iYear: Smallint): WordBool;
begin
Result := DefaultInterface.TaskExec(pAuth_id, bIsLock, iYear);
end;

function TclsLogin.ClosingStatus(nIndex: Smallint
const cSubId: WideString
iYear: Smallint

var bStateValue: WordBool): WordBool;
begin
Result := DefaultInterface.ClosingStatus(nIndex, cSubId, iYear, bStateValue);
end;

function TclsLogin.GetAccInfo(nIndex: Integer
var vValue: OleVariant): WordBool;
begin
Result := DefaultInterface.GetAccInfo(nIndex, vValue);
end;

procedure TclsLogin.ShutDown;
begin
DefaultInterface.ShutDown;
end;

function TclsLogin.FD_Month_Used(var dbszj: _Connection): Smallint;
begin
Result := DefaultInterface.FD_Month_Used(dbszj);
end;

function TclsLogin.CADemoMonth(var dbs: _Connection): Smallint;
begin
Result := DefaultInterface.CADemoMonth(dbs);
end;

function TclsLogin.IAMonthHandled(var ObjDatabase: _Connection): Smallint;
begin
Result := DefaultInterface.IAMonthHandled(ObjDatabase);
end;

function TclsLogin.GetIstallPath: WideString;
begin
Result := DefaultInterface.GetIstallPath;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TclsLoginProperties.Create(AServer: TclsLogin);
begin
inherited Create;
FServer := AServer;
end;

function TclsLoginProperties.GetDefaultInterface: _clsLogin;
begin
Result := FServer.DefaultInterface;
end;

function TclsLoginProperties.Get_AuthString: WideString;
begin
Result := DefaultInterface.Get_AuthString;
end;

procedure TclsLoginProperties.Set_AuthString(const Param1: WideString);
begin
DefaultInterface.Set_AuthString(Param1);
end;

procedure TclsLoginProperties.Set_cWebClient(const Param1: WideString);
begin
DefaultInterface.Set_cWebClient(Param1);
end;

function TclsLoginProperties.Get_cServer: OleVariant;
begin
Result := DefaultInterface.Get_cServer;
end;

procedure TclsLoginProperties.Set_cServer(Param1: OleVariant);
begin
DefaultInterface.Set_cServer(Param1);
end;

function TclsLoginProperties.Get_cSerial: OleVariant;
begin
Result := DefaultInterface.Get_cSerial;
end;

procedure TclsLoginProperties.Set_cSerial(Param1: OleVariant);
begin
DefaultInterface.Set_cSerial(Param1);
end;

function TclsLoginProperties.Get_cServerSerial: OleVariant;
begin
Result := DefaultInterface.Get_cServerSerial;
end;

function TclsLoginProperties.Get_cDbServerSerial: OleVariant;
begin
Result := DefaultInterface.Get_cDbServerSerial;
end;

function TclsLoginProperties.Get_LanguageID: Integer;
begin
Result := DefaultInterface.Get_LanguageID;
end;

function TclsLoginProperties.Get_cUserPassWord: WideString;
begin
Result := DefaultInterface.Get_cUserPassWord;
end;

function TclsLoginProperties.Get_UfSystemDb: IDispatch;
begin
Result := DefaultInterface.Get_UfSystemDb;
end;

function TclsLoginProperties.Get_LogState: Integer;
begin
Result := DefaultInterface.Get_LogState;
end;

function TclsLoginProperties.Get_ShareString: WideString;
begin
Result := DefaultInterface.Get_ShareString;
end;

function TclsLoginProperties.Get_SysPassword: WideString;
begin
Result := DefaultInterface.Get_SysPassword;
end;

function TclsLoginProperties.Get_cSubName: WideString;
begin
Result := DefaultInterface.Get_cSubName;
end;

function TclsLoginProperties.Get_cAcc_Id: WideString;
begin
Result := DefaultInterface.Get_cAcc_Id;
end;

procedure TclsLoginProperties.Set_cAcc_Id(var Param1: WideString);
begin
DefaultInterface.Set_cAcc_Id(Param1);
end;

function TclsLoginProperties.Get_cAccName: WideString;
begin
Result := DefaultInterface.Get_cAccName;
end;

function TclsLoginProperties.Get_CurDate: TDateTime;
begin
Result := DefaultInterface.Get_CurDate;
end;

function TclsLoginProperties.Get_cIYear: WideString;
begin
Result := DefaultInterface.Get_cIYear;
end;

function TclsLoginProperties.Get_iMonth: Smallint;
begin
Result := DefaultInterface.Get_iMonth;
end;

function TclsLoginProperties.Get_cUserId: WideString;
begin
Result := DefaultInterface.Get_cUserId;
end;

function TclsLoginProperties.Get_cUserName: WideString;
begin
Result := DefaultInterface.Get_cUserName;
end;

function TclsLoginProperties.Get_UfDbName: WideString;
begin
Result := DefaultInterface.Get_UfDbName;
end;

function TclsLoginProperties.Get_UfDbPath: WideString;
begin
Result := DefaultInterface.Get_UfDbPath;
end;

function TclsLoginProperties.Get_UfZtPath: WideString;
begin
Result := DefaultInterface.Get_UfZtPath;
end;

function TclsLoginProperties.Get_IsAdmin: WordBool;
begin
Result := DefaultInterface.Get_IsAdmin;
end;

function TclsLoginProperties.Get_TaskId: WideString;
begin
Result := DefaultInterface.Get_TaskId;
end;

{$ENDIF}

procedure Register;
begin
RegisterComponents('ActiveX',[TclsLogin]);
end;

end.
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
我引用_Tlb后,调用其Login函数,只传了第一个参数过去,Delphi不通过,
说缺参数,可后面的参数应该是可省略的,Vb调用时好只传了一个参数呀?
 
K

kgafly

Unregistered / Unconfirmed
GUEST, unregistred user!
楼主想干什么???把程序要实现的思路说清楚啊!
是不是要用Delphi调用U8并,主动填入Login休息登录啊?
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
我想用delPhi调用U8的登录对话框,正确登录后返回登录日期,登录用户,登录账套等信息,
二次开发一些接口用.
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
我在U8其他版本(8.13/8.20/8.21和早些版的850里一直这么用的,新版的850不能调用了,
但我看他的U8login.dll没什么变化呀!
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
没人用过吗?我才不信!

我提,提!
 

老人家

Unregistered / Unconfirmed
GUEST, unregistred user!
to xf163,
给上传一个U8产品。
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
to :老人家

262M,怎么上传?

我就是想不通,Vb一条语句一直好用,Delphi突然不行了.我昨天还怀疑自已的环境有问题,
于是卸了850装了个821同样的方法,完全可行. 我试了D5和D7都能调821.但不能调新的850.
 
X

xeen

Unregistered / Unconfirmed
GUEST, unregistred user!
to xf163:
vb 中调用出同样的错误吗?
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
VB不出错,一切正常,所以我才奇怪.
要是VB好出错,我该找到原因了.
 
X

xeen

Unregistered / Unconfirmed
GUEST, unregistred user!
是有点怪,看来你暂时只能写一大堆 EmptyParam 了
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
to :Xeen
EmptyParam? 用'',''....吗?(我试过,好像不行.)

 
X

xeen

Unregistered / Unconfirmed
GUEST, unregistred user!
Uflogin.login('DP',EmptyParam,EmtyParam,EmptyParam.....)
 
X

xf163

Unregistered / Unconfirmed
GUEST, unregistred user!
use comObj;
...
procedure TForm1.Button1Click(Sender: TObject);
var uflogin:OleVariant;
begin
try
uflogin:=CreateOleObject('u8login.clslogin');
if uflogin.Login('DP',EmptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam) then
begin
messageBox(Handle,'调用Login成功!','OK:',mb_ok);
end
else
begin
MessageBox(handle,'调用Login失败!','Error:',mb_ok+mb_iconerror);
end;
except
messageBox(handle,'Uflogin.Create 失败!','Error:',mb_ok);
end;
end;
执行时:

语句:if uflogin.Login('DP',EmptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam) then

Raised Exception Class EOleSysError with message '类型不匹配.'

use comObj,u8login_tlb;
...
procedure TForm1.Button1Click(Sender: TObject);
var uflogin:TclsLogin;
begin
try
uflogin:=TclsLogin.create(Self);
if uflogin.Login('DP',EmptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam) then
begin
messageBox(Handle,'调用Login成功!','OK:',mb_ok);
end
else
begin
MessageBox(handle,'调用Login失败!','Error:',mb_ok+mb_iconerror);
end;
except
messageBox(handle,'Uflogin.Create 失败!','Error:',mb_ok);
end;
end;
执行时:

语句:if uflogin.Login('DP',EmptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam,emptyParam) then
Types of actual and formal var parameters must be identical

无论我写多少个EmptyParam (我试了从0-10个),都是这个错误.
 
X

xeen

Unregistered / Unconfirmed
GUEST, unregistred user!
这么说login还是调用成功了,没抱错。只是返回False而已。
这就不是参数的问题了,可能调用Login前还有其他的设置(一些属性和方法)
你看看你VB调用是怎么成功的.
 
顶部