sxl0114 发表于 2006-11-20 22:28:00

[ARX]求教!

<P>请教各位大虾:调试时出现下面的是什么问题?就算我仅仅写一句:acedAlert("ppp")也出现如下类似的问题?不知是不是我设置的有问题?我用的是VC2005+objectARX2007.</P>
<P>.\HelloWorld.cpp(14) : error C2664: 'AcEdCommandStack::addCommand' : cannot convert parameter 1 from 'const char ' to 'const ACHAR *'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<BR>.\HelloWorld.cpp(18) : error C2664: 'AcEdCommandStack::removeGroup' : cannot convert parameter 1 from 'const char ' to 'const ACHAR *'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<BR>.\HelloWorld.cpp(22) : error C2664: 'acutPrintf' : cannot convert parameter 1 from 'const char ' to 'const ACHAR *'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<BR>Generating Code...<BR>Build log was saved at "<A href="file:///f:/vc2005/" target="_blank" >file://f:\vc2005\</A>新建文件夹\Step01\Release\BuildLog.htm"<BR>Step01 - 3 error(s), 0 warning(s)<BR><BR></P>

hact 发表于 2006-11-21 10:56:00

<P>把你的程序贴一下,大家一起看看啊,</P>
<P>'AcEdCommandStack::addCommand' : cannot convert parameter 1 from 'const char ' to 'const ACHAR *'<BR></P>

sxl0114 发表于 2006-11-21 18:38:00

<P>我在VC里新建了一个objectAR文件,只在入口函数添加了一句话:acedAlert("My Sample");不知道加的位置对不对。</P>
<P>class CfirstWizardApp : public AcRxArxApp {</P>
<P>public:<BR>&nbsp;CfirstWizardApp () : AcRxArxApp () {}</P>
<P>&nbsp;virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {<BR>&nbsp;&nbsp;// TODO: Load dependencies here</P>
<P>&nbsp;&nbsp;// You *must* call On_kInitAppMsg here<BR>&nbsp;&nbsp;AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;// TODO: Add your initialization code here<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acedAlert("My Sample");<BR>&nbsp;&nbsp;return (retCode) ;<BR>&nbsp;}</P>
<P>&nbsp;virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {<BR>&nbsp;&nbsp;// TODO: Add your code here</P>
<P>&nbsp;&nbsp;// You *must* call On_kUnloadAppMsg here<BR>&nbsp;&nbsp;AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;</P>
<P>&nbsp;&nbsp;// TODO: Unload dependencies here</P>
<P>&nbsp;&nbsp;return (retCode) ;<BR>&nbsp;}</P>
<P>&nbsp;virtual void RegisterServerComponents () {<BR>&nbsp;}</P>
<P>} ;</P>
<P>//-----------------------------------------------------------------------------<BR>IMPLEMENT_ARX_ENTRYPOINT(CfirstWizardApp)</P>
<P>调试的结果:acrxEntryPoint.cpp<BR>f:\vc2005\firstwizard\acrxentrypoint.cpp(46) : error C2664: 'acedAlert' : cannot convert parameter 1 from 'const char ' to 'const ACHAR *'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<BR>Build log was saved at "<A href="file:///f:/vc2005/firstWizard/Debug/BuildLog.htm" target="_blank" >file://f:\vc2005\firstWizard\Debug\BuildLog.htm</A>"<BR>firstWizard - 1 error(s), 0 warning(s)</P>

sxl0114 发表于 2006-11-21 18:51:00

<P>请问使用objectARX2007的大虾们,我是新手,我都不知道怎么用。</P>
<P>(1)是否需要在VC里设置些东西?我设置了一些,但是按照2004的做的</P>
<P>(2)怎样使用?怎样在VC里编成?是不是可以新建DLL文件或者ARX文件?然后呢? </P>
<P>(3)有没有相关的书籍,我能借到的书都是关于ARX2000的?能否提供。NET最好是2007的相关学习资料?</P>

asen 发表于 2009-9-4 19:42:00

acedAlert(L"My Sample");

luowy 发表于 2009-9-4 21:02:00

<p>autodesk有书籍,25美元,加运费75美元</p>

wj_job 发表于 2009-9-4 21:49:00

function XML() {
   
}

忽悠悠 发表于 2009-9-8 11:40:00

<p>CAD2007要求Unicode,要添加TChar.h,然后把char替换成TCHAR</p>

sunny20102 发表于 2012-10-15 15:22:58

char ACHAR TCHAR
都被弄糊涂了,现在学习ObjectArx,C2664 的错误老出现,
不是这里就是那里
Autodesk 究竟是怎么搞的
快崩溃了

Hermite 发表于 2012-11-19 11:39:38

忽悠悠 发表于 2009-9-8 11:40 static/image/common/back.gif
CAD2007要求Unicode,要添加TChar.h,然后把char替换成TCHAR

哪里有资料可以看看呀
页: [1] 2
查看完整版本: [ARX]求教!