D
desertsmoke
Unregistered / Unconfirmed
GUEST, unregistred user!
环境1:
WinXP Pro+SP1
Delphi6 Enterprise+Update pack2+RTL Update Pack 3
环境2:
Win2000 Pro+Sp3
Delphi7
问题:delphi->新建->ActiveX->Transactional Object创建一个COM+服务器,修改、保存,编译、安装都没问题。但是:[red]关闭这个工程,然后重新打开,保存(.dpr或_TLB.pas)就会出现错误提示如下:[/red][purple](注:并不是每次都一定出现!!!)[/purple]
---------------------------
Error
---------------------------
The type library ComProjFund had translation errors or warnings.
Some information may be lost or modified. do
you want save with these modifications?
---------------------------
Yes No
---------------------------
如果保存XXX_TLB.pas则会出现下面的情况:
[blue]原来文件内容(部分):
-------------------------------------------------------------
const
// TypeLibrary Major and minor versions
Test001MajorVersion = 1;
Test001MinorVersion = 0;
LIBID_Test001: TGUID = '{A30A0937-24E4-4132-9047-2190154B4EA1}';
IID_ITest001: TGUID = '{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}';
CLASS_Test001: TGUID = '{19E13C2D-C57C-40AE-9B95-6C283C06FB23}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
ITest001 = interface;
ITest001Disp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
Test001 = ITest001;
// *********************************************************************//
// Interface: ITest001
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001 = interface(IDispatch)
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
safecall;
end;
// *********************************************************************//
// DispIntf: ITest001Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001Disp = dispinterface
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
dispid 1;
end;
// *********************************************************************//
// The Class CoTest001 provides a Create and CreateRemote method to
// create instances of the default interface ITest001 exposed by
// the CoClass Test001. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoTest001 = class
class function Create: ITest001;
class function CreateRemote(const MachineName: string): ITest001;
end;
implementation
uses ComObj;
class function CoTest001.Create: ITest001;
begin
Result := CreateComObject(CLASS_Test001) as ITest001;
end;
class function CoTest001.CreateRemote(const MachineName: string): ITest001;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Test001) as ITest001;
end;
-------------------------------------------------------------[/blue]
保存后的文件内容:
-------------------------------------------------------------
const
// TypeLibrary Major and minor versions
Test001MajorVersion = 1;
Test001MinorVersion = 0;
LIBID_Test001: TGUID = '{A30A0937-24E4-4132-9047-2190154B4EA1}';
IID_ITest001: TGUID = '{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}';
[red]CLASS_Test001_[/red]: TGUID = '{19E13C2D-C57C-40AE-9B95-6C283C06FB23}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
ITest001 = interface;
ITest001Disp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
[red]Test001_[/red] = ITest001;
// *********************************************************************//
// Interface: ITest001
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001 = interface(IDispatch)
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
safecall;
end;
// *********************************************************************//
// DispIntf: ITest001Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001Disp = dispinterface
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
dispid 1;
end;
// *********************************************************************//
// The Class CoTest001_ provides a Create and CreateRemote method to
// create instances of the default interface ITest001 exposed by
// the CoClass Test001_. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
[red]CoTest001_[/red] = class
class function Create: ITest001;
class function CreateRemote(const MachineName: string): ITest001;
end;
implementation
uses ComObj;
class function [red]CoTest001_[/red].Create: ITest001;
begin
Result := CreateComObject([red]CLASS_Test001_[/red]) as ITest001;
end;
class function [red]CoTest001_[/red].CreateRemote(const MachineName: string): ITest001;
begin
Result := CreateRemoteComObject(MachineName, [red]CLASS_Test001_[/red]) as ITest001;
end;
-------------------------------------------------------------
从此之后,只要保存就会出现这个问题!
哪位碰到过这种问题?如何解决的?请不吝赐教,200分奉上,多谢。
[red]注:delphi已经重新安装过。[/red]
WinXP Pro+SP1
Delphi6 Enterprise+Update pack2+RTL Update Pack 3
环境2:
Win2000 Pro+Sp3
Delphi7
问题:delphi->新建->ActiveX->Transactional Object创建一个COM+服务器,修改、保存,编译、安装都没问题。但是:[red]关闭这个工程,然后重新打开,保存(.dpr或_TLB.pas)就会出现错误提示如下:[/red][purple](注:并不是每次都一定出现!!!)[/purple]
---------------------------
Error
---------------------------
The type library ComProjFund had translation errors or warnings.
Some information may be lost or modified. do
you want save with these modifications?
---------------------------
Yes No
---------------------------
如果保存XXX_TLB.pas则会出现下面的情况:
[blue]原来文件内容(部分):
-------------------------------------------------------------
const
// TypeLibrary Major and minor versions
Test001MajorVersion = 1;
Test001MinorVersion = 0;
LIBID_Test001: TGUID = '{A30A0937-24E4-4132-9047-2190154B4EA1}';
IID_ITest001: TGUID = '{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}';
CLASS_Test001: TGUID = '{19E13C2D-C57C-40AE-9B95-6C283C06FB23}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
ITest001 = interface;
ITest001Disp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
Test001 = ITest001;
// *********************************************************************//
// Interface: ITest001
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001 = interface(IDispatch)
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
safecall;
end;
// *********************************************************************//
// DispIntf: ITest001Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001Disp = dispinterface
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
dispid 1;
end;
// *********************************************************************//
// The Class CoTest001 provides a Create and CreateRemote method to
// create instances of the default interface ITest001 exposed by
// the CoClass Test001. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoTest001 = class
class function Create: ITest001;
class function CreateRemote(const MachineName: string): ITest001;
end;
implementation
uses ComObj;
class function CoTest001.Create: ITest001;
begin
Result := CreateComObject(CLASS_Test001) as ITest001;
end;
class function CoTest001.CreateRemote(const MachineName: string): ITest001;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Test001) as ITest001;
end;
-------------------------------------------------------------[/blue]
保存后的文件内容:
-------------------------------------------------------------
const
// TypeLibrary Major and minor versions
Test001MajorVersion = 1;
Test001MinorVersion = 0;
LIBID_Test001: TGUID = '{A30A0937-24E4-4132-9047-2190154B4EA1}';
IID_ITest001: TGUID = '{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}';
[red]CLASS_Test001_[/red]: TGUID = '{19E13C2D-C57C-40AE-9B95-6C283C06FB23}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
ITest001 = interface;
ITest001Disp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
[red]Test001_[/red] = ITest001;
// *********************************************************************//
// Interface: ITest001
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001 = interface(IDispatch)
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
safecall;
end;
// *********************************************************************//
// DispIntf: ITest001Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}
// *********************************************************************//
ITest001Disp = dispinterface
['{DAC8C355-7CD6-436D-8EC4-C2C4F65440D5}']
function GetMsg(ErrCode: Integer): WideString;
dispid 1;
end;
// *********************************************************************//
// The Class CoTest001_ provides a Create and CreateRemote method to
// create instances of the default interface ITest001 exposed by
// the CoClass Test001_. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
[red]CoTest001_[/red] = class
class function Create: ITest001;
class function CreateRemote(const MachineName: string): ITest001;
end;
implementation
uses ComObj;
class function [red]CoTest001_[/red].Create: ITest001;
begin
Result := CreateComObject([red]CLASS_Test001_[/red]) as ITest001;
end;
class function [red]CoTest001_[/red].CreateRemote(const MachineName: string): ITest001;
begin
Result := CreateRemoteComObject(MachineName, [red]CLASS_Test001_[/red]) as ITest001;
end;
-------------------------------------------------------------
从此之后,只要保存就会出现这个问题!
哪位碰到过这种问题?如何解决的?请不吝赐教,200分奉上,多谢。
[red]注:delphi已经重新安装过。[/red]