我新建了一个 remote Data module 系统就自动生成了 **_TLB.pas 文件.为什么我在**_TLB.pas 的接口里面定义自已的函数,保存了又就跟原来生成的一样了?在网上找了半天还是没找到答案,请高手帮心啊!例如unit ScktSrvr_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 : 1.2
// File generated on 2007-9-5 9:39:50 from Type Library described below.// ************************************************************************ //
// Type Lib: F:\wfl\myServer\ScktSrvr.tlb (1)
// LIBID: {10F8A33B-B5E0-4D8C-ADCE-D4A36D1E94DC}
// LCID: 0
// Helpfile:
// HelpString: ScktSrvr Library
// DepndLst:
// (1) v1.0 Midas, (C:\WINDOWS\system32\midas.dll)
// (2) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interfaceuses Windows, ActiveX, Classes, Graphics, Midas, StdVCL, Variants;
// *********************************************************************//
// 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
ScktSrvrMajorVersion = 1;
ScktSrvrMinorVersion = 0; LIBID_ScktSrvr: TGUID = '{10F8A33B-B5E0-4D8C-ADCE-D4A36D1E94DC}'; IID_Itest: TGUID = '{234031C4-60C2-4601-9F41-191E27FCF18A}';
CLASS_test: TGUID = '{ABEB10B2-3060-4F79-8519-EBA88500E20E}';
type// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
Itest = interface;
ItestDisp = dispinterface;// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
test = Itest;
// *********************************************************************//
// Interface: Itest
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {234031C4-60C2-4601-9F41-191E27FCF18A}
// *********************************************************************//
Itest = interface(IAppServer)
['{234031C4-60C2-4601-9F41-191E27FCF18A}'] procedure test()safecall; //自已定义的方法 end;// *********************************************************************//
// DispIntf: ItestDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {234031C4-60C2-4601-9F41-191E27FCF18A}
// *********************************************************************//
ItestDisp = dispinterface
['{234031C4-60C2-4601-9F41-191E27FCF18A}'] procedure test(); //自已定义的方法 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 Cotest provides a Create and CreateRemote method to
// create instances of the default interface Itest exposed by
// the CoClass test. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
Cotest = class
class function Create: Itest;
class function CreateRemote(const MachineName: string): Itest;
end;implementationuses ComObj;class function Cotest.Create: Itest;
begin
Result := CreateComObject(CLASS_test) as Itest;
end;class function Cotest.CreateRemote(const MachineName: string): Itest;
begin
Result := CreateRemoteComObject(MachineName, CLASS_test) as Itest;
end;end.我保存后就又成了刚创建的样子了定义的 procedure test() 就没有了!
??????
// 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 : 1.2
// File generated on 2007-9-5 9:39:50 from Type Library described below.// ************************************************************************ //
// Type Lib: F:\wfl\myServer\ScktSrvr.tlb (1)
// LIBID: {10F8A33B-B5E0-4D8C-ADCE-D4A36D1E94DC}
// LCID: 0
// Helpfile:
// HelpString: ScktSrvr Library
// DepndLst:
// (1) v1.0 Midas, (C:\WINDOWS\system32\midas.dll)
// (2) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interfaceuses Windows, ActiveX, Classes, Graphics, Midas, StdVCL, Variants;
// *********************************************************************//
// 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
ScktSrvrMajorVersion = 1;
ScktSrvrMinorVersion = 0; LIBID_ScktSrvr: TGUID = '{10F8A33B-B5E0-4D8C-ADCE-D4A36D1E94DC}'; IID_Itest: TGUID = '{234031C4-60C2-4601-9F41-191E27FCF18A}';
CLASS_test: TGUID = '{ABEB10B2-3060-4F79-8519-EBA88500E20E}';
type// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
Itest = interface;
ItestDisp = dispinterface;// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
test = Itest;
// *********************************************************************//
// Interface: Itest
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {234031C4-60C2-4601-9F41-191E27FCF18A}
// *********************************************************************//
Itest = interface(IAppServer)
['{234031C4-60C2-4601-9F41-191E27FCF18A}'] procedure test()safecall; //自已定义的方法 end;// *********************************************************************//
// DispIntf: ItestDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {234031C4-60C2-4601-9F41-191E27FCF18A}
// *********************************************************************//
ItestDisp = dispinterface
['{234031C4-60C2-4601-9F41-191E27FCF18A}'] procedure test(); //自已定义的方法 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 Cotest provides a Create and CreateRemote method to
// create instances of the default interface Itest exposed by
// the CoClass test. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
Cotest = class
class function Create: Itest;
class function CreateRemote(const MachineName: string): Itest;
end;implementationuses ComObj;class function Cotest.Create: Itest;
begin
Result := CreateComObject(CLASS_test) as Itest;
end;class function Cotest.CreateRemote(const MachineName: string): Itest;
begin
Result := CreateRemoteComObject(MachineName, CLASS_test) as Itest;
end;end.我保存后就又成了刚创建的样子了定义的 procedure test() 就没有了!
??????
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货