jay-pan 发表于 2006-5-15 16:27:00

求助高手!

程序中我有2个对话框,分别设置2个机构(parallel和aclinic)的参数.当输入命令行输入parallel要调用parallel所对应的对话框!输入aclinic调用aclinic)所对应的对话框!我写的程序调不出来!请教高手指点一下!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CAcModuleResourceOverride resOverride;<BR>&nbsp;char type;<BR>&nbsp;int retCode;<BR>&nbsp;retCode = acedGetString(1, "\nTo choose frame type:", type);<BR>&nbsp;if(retCode = !RTNORM || type == '\0')<BR>&nbsp;{<BR>&nbsp;&nbsp;acutPrintf("\nInvalid type name.");<BR>&nbsp;&nbsp;return;<BR>&nbsp;}<BR>&nbsp;if(type == "parallel")<BR>&nbsp;&nbsp;&nbsp; {&nbsp;<BR>&nbsp;&nbsp;CWindoParaDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));<BR>&nbsp;&nbsp;.............................................<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..............................................<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; else if(type == "aclinic")<BR>&nbsp;&nbsp;&nbsp; {&nbsp; <BR>&nbsp;&nbsp;CWindoAclDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));<BR>&nbsp;&nbsp;...............................................<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .................................................<BR>&nbsp;&nbsp;&nbsp; }

linyiwq 发表于 2006-5-15 17:59:00

<P>CWindoParaDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));//这一句后面要加上下面这一句</P>
<P>dlg.DoModal();</P>

jay-pan 发表于 2006-5-16 15:51:00

<P>加了dlg.Modal()还是不行!执行的时候出现异常内部错误!请高手再指点一下 </P>

jbstys 发表于 2006-5-16 20:18:00

<P>type == "parallel"</P>
<P>改为</P>
<P>strcpy(type,"parallel")</P>
<P>type == "aclinic"</P>
<P>改为</P>
<P>strcpy(type,"aclinic")</P>
<P>&nbsp;</P>
<P>就可以了 </P>

linyiwq 发表于 2006-5-17 08:34:00

<P>不应该用strcpy()函数,而应该用strcmp()函数</P>
<P>判断而不是拷贝</P>

linyiwq 发表于 2006-5-17 09:12:00

<P>CAcModuleResourceOverride resOverride;<BR>&nbsp;char type;<BR>&nbsp;int retCode;<BR>&nbsp;retCode = acedGetString(1, "\nTo choose frame type:", type);<BR>&nbsp;if(retCode = !RTNORM || type == '\0'){<BR>&nbsp;&nbsp;acutPrintf("\nInvalid type name.");<BR>&nbsp;&nbsp;return;<BR>&nbsp;}<BR>&nbsp;if(strcmp(type,"parallel")==0){&nbsp;<BR>&nbsp;&nbsp;CWindoParaDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));<BR>&nbsp;&nbsp;dlg.DoModal();</P>
<P>.....<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; else if(strcmp(type,"aclinic")==0){<BR>&nbsp;&nbsp;CWindoAclDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));<BR>&nbsp;&nbsp;dlg.DoModal();</P>
<P>......<BR>&nbsp;&nbsp;&nbsp; }</P>

jay-pan 发表于 2006-5-17 10:26:00

谢谢大家了!问题解决了!

jbstys 发表于 2006-5-18 18:13:00

<P>:)</P>

<P>搞错了</P>
页: [1]
查看完整版本: 求助高手!