为什么我自己为TremoteDataModule添加的属性和方法!在可户端不能使用!(50分)

  • 主题发起人 主题发起人 pnileotgx2002
  • 开始时间 开始时间
P

pnileotgx2002

Unregistered / Unconfirmed
GUEST, unregistred user!
开发MIDAS:
代码:ClientDataModule.ClientDataSet1.AppServer.QueryNew(Edit1.Text );
程序运行到这的时候提示!Undeclared identifer 'QueryNew'
QueryNew这个过程是我给添加的!请问为什么!
 
1、没有注册中间层程序。
2、没有该方法。
3、ClientDataSet是否已经连接中间层的数据集?
 
你所说的我都已经作过了!
不知还有没有其他的原因!
 
我的 Server_tlb 文件!
unit Server_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.130 $
// File generated on 2003-2-28 20:33:43 from Type Library described below.
// ************************************************************************ //
// Type Lib: E:/server2/Server.tlb (1)
// LIBID: {A36A9294-9600-46D8-BE3B-44336DF231FF}
// LCID: 0
// Helpfile:
// DepndLst:
// (1) v1.0 Midas, (C:/WINNT/System32/midas.dll)
// (2) v2.0 stdole, (C:/WINNT/System32/stdole2.tlb)
// (3) v4.0 StdVCL, (C:/WINNT/System32/stdvcl40.dll)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
interface
uses ActiveX, Classes, Graphics, Midas, StdVCL, Variants, Windows;


// *********************************************************************//
// 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
ServerMajorVersion = 1;
ServerMinorVersion = 0;
LIBID_Server: TGUID = '{A36A9294-9600-46D8-BE3B-44336DF231FF}';
IID_IServerReDataModule: TGUID = '{E8AB028D-9A29-454B-9C1E-8E67EEF5879B}';
CLASS_ServerReDataModule: TGUID = '{781C6A1D-BA42-43F3-8FF1-CCFC333DD5FC}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
IServerReDataModule = interface;
IServerReDataModuleDisp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
ServerReDataModule = IServerReDataModule;

// *********************************************************************//
// Interface: IServerReDataModule
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {E8AB028D-9A29-454B-9C1E-8E67EEF5879B}
// *********************************************************************//
IServerReDataModule = interface(IAppServer)
['{E8AB028D-9A29-454B-9C1E-8E67EEF5879B}']
function Get_ClientCount: Integer;
safecall;
procedure Set_ClientCount(Value: Integer);
safecall;
procedure QueryNew(CountryName: OleVariant);
safecall;
property ClientCount: Integer read Get_ClientCount write Set_ClientCount;
end;

// *********************************************************************//
// DispIntf: IServerReDataModuleDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {E8AB028D-9A29-454B-9C1E-8E67EEF5879B}
// *********************************************************************//
IServerReDataModuleDisp = dispinterface
['{E8AB028D-9A29-454B-9C1E-8E67EEF5879B}']
property ClientCount: Integer dispid 1;
procedure QueryNew(CountryName: OleVariant);
dispid 2;
function AS_ApplyUpdates(const ProviderName: WideString;
Delta: OleVariant;
MaxErrors: Integer;
out ErrorCount: Integer;
var OwnerData: OleVariant): OleVariant;
dispid 20000000;
function AS_GetRecords(const ProviderName: WideString;
Count: Integer;
out RecsOut: Integer;
Options: Integer;
const CommandText: WideString;
var Params: OleVariant;
var OwnerData: OleVariant): OleVariant;
dispid 20000001;
function AS_DataRequest(const ProviderName: WideString;
Data: OleVariant): OleVariant;
dispid 20000002;
function AS_GetProviderNames: OleVariant;
dispid 20000003;
function AS_GetParams(const ProviderName: WideString;
var OwnerData: OleVariant): OleVariant;
dispid 20000004;
function AS_RowRequest(const ProviderName: WideString;
Row: OleVariant;
RequestType: Integer;
var OwnerData: OleVariant): OleVariant;
dispid 20000005;
procedure AS_Execute(const ProviderName: WideString;
const CommandText: WideString;
var Params: OleVariant;
var OwnerData: OleVariant);
dispid 20000006;
end;

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

implementation
uses ComObj;
class function CoServerReDataModule.Create: IServerReDataModule;
begin
Result := CreateComObject(CLASS_ServerReDataModule) as IServerReDataModule;
end;

class function CoServerReDataModule.CreateRemote(const MachineName: string): IServerReDataModule;
begin
Result := CreateRemoteComObject(MachineName, CLASS_ServerReDataModule) as IServerReDataModule;
end;

end.
从Interface 中已经看到很明显在类型库中啊!注册过了
 
你注册的中间层程序可能跟你这版本不一样,比如你在C:/某个目录下运行中间层程序注册,
然后你在D盘修改编译程序,这样你修改后的内容并没有在你注册的程序里体现。
 
你是否是自己手工在程序中添加的?那样不行。使用Delphi菜单上的类库管理,在那儿添加method或属性,并设置输入输出参数以及结果类型。
 
必须要在类型库中添加,否则谁也不知道你这个方法,只能用Delphi提供的类型库编辑器。
 
后退
顶部