为什么出现此错误?包含有部分源代码! (100分)

  • 主题发起人 主题发起人 landina
  • 开始时间 开始时间
L

landina

Unregistered / Unconfirmed
GUEST, unregistred user!
我用客户端连接远程服务器时出现“接口不被支持”的错误!为什么?当应用服务器和客户端
同一台计算机时运行正常。
 
你的socket server有没打开呀?
在delphi的bin目录下。socktsrv。exe
 
打开scktsrvr.exe
 
scktsrvr.exe的设置
 
我没有采用TSocketConnection控件。
我的代码如下:
Server端定义:
TRate = class(TAutoObject, IRate)
protected
procedure AddRate(const StartDate, EndDate, Rate, DepositType: WideString);
safecall;
procedure DeleteRate(const StartDate, EndDate, Rate, DepositType: WideString); safecall;
procedure UpdateRate(const OldStartDate, OldEndDate, OldRate,
OldDepositType, NewStartDate, NewEndDate, NewRate,
NewDepositType: WideString); safecall;
procedure GetAllRate(out aAllRate: OleVariant); safecall;
procedure GetRate(const StartDate, Rate, DepositType: WideString;
out EndDate: OleVariant); safecall;
{ Protected declarations }
end;

客户端部分代码:
unit ufrmGetAllRate;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uframeGetAllRate, uframeNavigator, Menus;

type
TfrmRate = class(TForm)
frameGetAllRate1: TframeGetAllRate;
frameNavigator1: TframeNavigator;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure frameNavigator1Action5Execute(Sender: TObject);
procedure frameNavigator1Action1Execute(Sender: TObject);
procedure frameNavigator1Action2Execute(Sender: TObject);
procedure frameNavigator1Action3Execute(Sender: TObject);
procedure frameGetAllRate1sgRateDblClick(Sender: TObject);
procedure frameNavigator1Action2Update(Sender: TObject);
procedure frameNavigator1Action3Update(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frmRate: TfrmRate;

implementation

uses ufrmModifyRate, BankServer_TLB;

{$R *.dfm}

procedure TfrmRate.FormCreate(Sender: TObject);
begin
frameGetAllRate1.ShowAllRate ;
end;

procedure TfrmRate.FormClose(Sender: TObject; var Action: TCloseAction);
begin
frmRate := nil;
Action := cafree;
end;

procedure TfrmRate.frameNavigator1Action5Execute(Sender: TObject);
begin
Close;
end;

procedure TfrmRate.frameNavigator1Action1Execute(Sender: TObject);
var
s:string;
begin
s:= '';
if not assigned(frmModifyRate) then
frmModifyRate := TfrmModifyRate.Create(Application);
frmModifyRate.Caption := '增加新利率';
frmModifyRate.frameModifyRate1.InitRate(s,s,s,s);
frmModifyRate.ShowModal;
frameGetAllRate1.ShowAllRate ;
end;

procedure TfrmRate.frameNavigator1Action2Execute(Sender: TObject);
var
StartDate,EndDate,Rate,DepositType:String;
begin
if not assigned(frmModifyRate) then
frmModifyRate := TfrmModifyRate.Create(Application);
frmModifyRate.Caption := '修改利率信息';
StartDate := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][0];
EndDate := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][1];
Rate := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][2];
DepositType := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][3];
frmModifyRate.frameModifyRate1.InitRate(StartDate,EndDate,Rate,DepositType);
frmModifyRate.ShowModal;
frameGetAllRate1.ShowAllRate ;
end;

procedure TfrmRate.frameNavigator1Action3Execute(Sender: TObject);
var
StartDate,EndDate,Rate,DepositType:String;
cRate:IRate;
begin
if messagedlg('您确认要删除此利率信息?',mtwarning,[mbYes,mbNo],0)=mrYes then
begin
StartDate := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][0];
EndDate := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][1];
Rate := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][2];
DepositType := frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][3];
cRate := CoRate.Create;
cRate.DeleteRate(StartDate,EndDate,Rate,DepositType);
frameGetAllRate1.ShowAllRate ;
end;
end;

procedure TfrmRate.frameGetAllRate1sgRateDblClick(Sender: TObject);
begin
frameNavigator1Action2Execute(Sender);
end;

procedure TfrmRate.frameNavigator1Action2Update(Sender: TObject);
begin
frameNavigator1.Action2.Enabled := (trim(frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][0])<>'')
end;

procedure TfrmRate.frameNavigator1Action3Update(Sender: TObject);
begin
frameNavigator1.Action3.Enabled := (trim(frameGetAllRate1.sgRate.Rows[frameGetAllRate1.sgRate.Row][0])<>'')
end;

end.

 
后退
顶部