D
ddzhouqian
Unregistered / Unconfirmed
GUEST, unregistred user!
在DELPHI6中按部就班的用李维的例子PDemoProfileObject,客户端(本机)老是提示interface not supported, 请问到底什么问题,搞的一头雾水,而用delphi5是可以的,在CSDN上找到篇文章,(Transactional objects support MTS and COM+. MTS support was exclusive to Delphi 5 Enterprise but transactional objects are supported in Delphi 6 Professional Edition.
)好象是DELHI6只有Professional 才支持啊,COM+我用的Transactional object
大至代码如下:
客户端:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,PDemoProfileObject_TLB;
type
TForm1 = class(TForm)
edName: TEdit;
edPassword: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
edCookie: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
USES ComObj;
procedure TForm1.Button1Click(Sender: TObject);
var LoginObj:IMTSSecurityObj;
vCookie:OleVariant;
begin
// LoginObj:=CoMTSSecurityObj.CreateRemote('ztech-ec03c9ecd');
LoginObj:=CoMTSSecurityObj.CreateRemote('127.0.0.1');
LoginObj.Login(edName.Text,edPassword.Text,vCookie);
if vCookie<>'' then
begin
edCookie.Text:=vCookie;
edCookie.Visible:=True;
end
else
begin
Application.MessageBox('无法登陆','警告',MB_OK+MB_ICONWARNING);
end;
end;
)好象是DELHI6只有Professional 才支持啊,COM+我用的Transactional object
大至代码如下:
客户端:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,PDemoProfileObject_TLB;
type
TForm1 = class(TForm)
edName: TEdit;
edPassword: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
edCookie: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
USES ComObj;
procedure TForm1.Button1Click(Sender: TObject);
var LoginObj:IMTSSecurityObj;
vCookie:OleVariant;
begin
// LoginObj:=CoMTSSecurityObj.CreateRemote('ztech-ec03c9ecd');
LoginObj:=CoMTSSecurityObj.CreateRemote('127.0.0.1');
LoginObj.Login(edName.Text,edPassword.Text,vCookie);
if vCookie<>'' then
begin
edCookie.Text:=vCookie;
edCookie.Visible:=True;
end
else
begin
Application.MessageBox('无法登陆','警告',MB_OK+MB_ICONWARNING);
end;
end;