哪个IDL叫什么我也不知,再进来给点资料大家
升级问题
The TypeLib interface Export option, TCorbaConnection,
CorbaDataModule, and CorbaObject components have been
removed from Delphi. They were based on VisiBroker 3.3
Orb, which is no longer shipped with Delphi.
To convert a VisiBroker 3.3 tlb file to a CORBA IDL file,
use the tlibimp utility from the command line, for example:
C:/ *SomePath* >tlibimp -Ic+ MyTLBFile.tlb
Tlibimp generates the following files:
* MyTLBFile_TLB.dcr
* MyTLBFile_TLB.pas
* MyTLBFile.idl
Next, choose File | New | Other and click the Corba tab
to access either the CORBA Client or Server wizard.
Specify the newly created IDL file in the wizard to generate
the stubs and skeletons. Now transfer the function code from the
VisiBroker 3.3 application to the new VisiBroker 4.5 application.
解决方法
All of the functionality to recreate the removed components
is still available in Delphi 7, however, you will need to
create your own wrappers. For a code example that uses CORBA
and Midas WITHOUT using the removed components, see Midas XML in the
following directory:
C:/Program Files/Borland/Delphi7/Demos/Corba/IDL2PAS
里面的内容的内量其实就是叫你定义一个方法,以Corba的any类型(相当于Variant)返回数据
{
//注意这里,经常会见到有一些关于CORBA与BDE帖子,这个地方可以参考
Look at the DMPooler module. This shows a thread safe technieque for pooling
database connections. Instead of getting a new connection for every database
request, this module creates a pool of connections and reuses them. That way
BDE resourse errors are avoided.
}
如果觉得自己写一个IDL太烦,可以用Rose,可能还有一些别的工具 方法如下
1选择new ,在Create New Model对话框中选cancel
2在中间的竖条中选Interface画在右边的纸上
3右键New Interface选open standard specification
5在Operations中增加一个方法,确认
6选Tools中的Corba/syntax check,如果在下面的log下没出现Error,进行下一步
7选Tools中的Corba/Generate code
8按Edit新增一个保存路径,如D:/CORBA/(好像根目录会出错),选中两边,按assign
现在在D:/CORBA/下会出现一个NewInterface.idl,内容
//Source file: D:/CORBA/NewInterface.idl
#ifndef __NEWINTERFACE_DEFINED
#define __NEWINTERFACE_DEFINED
/* CmIdentification
%X% %Q% %Z% %W% */
interface NewInterface {
/*
@roseuid 3E968C2100BB */
any opname ();
};
#endif
9现在打个Delphi,选Tools/regenerate Corba IDL files,按Add,增加NewInterface.idl,按Generate,这时
D:/CORBA/中如出现Delphi Corba
的c ,i ,s Impl,4个pas文件,现在可以按照传统的方式编码了,可以用
Corba Client application ,Corba Server application向导完成这个功能
unit NewInterface_i;
{This file was generated on 11 Apr 2003 09:44:02 GMT by version 03.03.03.C1.A2}
{of the Inprise VisiBroker idl2pas CORBA IDL compiler. }
{Please do not edit the contents of this file. You should instead edit and }
{recompile the original IDL which was located in the file }
{D:/CORBA/NewInterface.idl. }
{Delphi Pascal unit : NewInterface_i }
{derived from IDL module : default }
interface
uses
CORBA;
type
NewInterface = interface;
NewInterface = interface
['{70955352-5D2C-851E-69E3-D665A093A60F}']
function opname : Any;
end;