懂corba的高手请进来
我的idl定义成下面的形式
module Sub {
struct Param{
string str;
long begpos;
long endpos;
string errmes;
};
interface Getstring{
Param getstruct();
};
interface stringmaker{
Getstring Trans(in Param oldStr);
};
};
我实现接口stringmaker(我写成了stringmakerImpl类),然后在服务器文件中我需要stringmakerImpl类的一个实例,写法如下: stringmakerImpl managerServant;
在编译时系统却提示下面出错信息:
“[C++ Error] exam.cpp(35): E2352 Cannot create instance of abstract class 'stringmakerImpl'
[C++ Error] exam.cpp(35): E2353 Class 'stringmakerImpl' is abstract because of 'POA_Sub::stringmaker::Trans(long) = 0'”
我的实现类stringmakerImpl写法如下:
class stringmakerImpl : public virtual POA_Sub::stringmaker,
public virtual PortableServer::ServantBase
{
public:
stringmakerImpl(){}
Sub::Getstring_ptr Trans(Sub::Param_ptr oldstruct)
{
char* oldstr ;
CORBA::Long begpos;
CORBA::Long endpos;
oldstr = oldstruct->str;
begpos = oldstruct->begpos;
endpos = oldstruct->endpos;
......
这是什么原因呢 难道结构体不能作为函数的参数进行传递吗?
如果能传递,具体的写法是什么样的呢?
谢谢