xsyww 发表于 2010-6-29 16:15:00

[求助]自定义对象的rxInit()函数,编译时说是私有。求助啊~

<p>MyClass个派生自AcDbObject类</p>
<p>按照一个教程的代码敲的,然后在如下的函数里</p>
<p>&nbsp;</p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;virtual AcRx::AppRetCode On_kInitAppMsg(void* pkt)<br/>&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // TODO: Load dependencies here</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // You *must* call On_kInitAppMsg here<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg(pkt);</font></p>
<p>&nbsp;</p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // TODO: 在此添加额外的初始化代码<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyClass::rxInit();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;就是这个报错,说是 <font style="BACKGROUND-COLOR: #ffffff" face="Verdana">error C2248: “MyClass::rxInit”: 无法访问 private 成员(在“MyClass”类中声明)</font><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acrxBuildClassHierarchy();</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return retCode;<br/>&nbsp;}</font></p>
<p>&nbsp;</p>
<p>但是我的MyClass类中并没有重载这个rxInit()函数,并且在如下的函数里 MyClass::desc()函数也报了同样的错误。。。</p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;virtual AcRx::AppRetCode On_kUnloadAppMsg(void* pkt)<br/>&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // TODO: 在此添加额外的清理代码</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // You *must* call On_kUnloadAppMsg here<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg(pkt);</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // TODO: Unload dependencies here<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deleteAcRxClass(MyClass::desc()); //&nbsp;<font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;error C2248: “MyClass::desc”: 无法访问 private 成员(在“MyClass”类中声明)&nbsp;<br/></font></font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return retCode;<br/>&nbsp;}</font></p>
<p>&nbsp;</p>
<p>麻烦各位高手看看,是我哪少写了什么东西?这两个函数在AcDbObject里是私有的,那该怎么调用啊。。。</p>
<p>&nbsp;</p>
<p>谢谢了。。</p>
<p>&nbsp;</p>
页: [1]
查看完整版本: [求助]自定义对象的rxInit()函数,编译时说是私有。求助啊~