求助高手!
程序中我有2个对话框,分别设置2个机构(parallel和aclinic)的参数.当输入命令行输入parallel要调用parallel所对应的对话框!输入aclinic调用aclinic)所对应的对话框!我写的程序调不出来!请教高手指点一下!CAcModuleResourceOverride resOverride;
char type;
int retCode;
retCode = acedGetString(1, "\nTo choose frame type:", type);
if(retCode = !RTNORM || type == '\0')
{
acutPrintf("\nInvalid type name.");
return;
}
if(type == "parallel")
{
CWindoParaDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));
.............................................
..............................................
}
else if(type == "aclinic")
{
CWindoAclDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));
...............................................
.................................................
} CWindoParaDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));//这一句后面要加上下面这一句
dlg.DoModal();
加了dlg.Modal()还是不行!执行的时候出现异常内部错误!请高手再指点一下
type == "parallel"
改为
strcpy(type,"parallel")
type == "aclinic"
改为
strcpy(type,"aclinic")
就可以了
不应该用strcpy()函数,而应该用strcmp()函数
判断而不是拷贝
CAcModuleResourceOverride resOverride;
char type;
int retCode;
retCode = acedGetString(1, "\nTo choose frame type:", type);
if(retCode = !RTNORM || type == '\0'){
acutPrintf("\nInvalid type name.");
return;
}
if(strcmp(type,"parallel")==0){
CWindoParaDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));
dlg.DoModal();
.....
}
else if(strcmp(type,"aclinic")==0){
CWindoAclDlg dlg(CWnd::FromHandle(adsw_acadMainWnd()));
dlg.DoModal();
......
}
谢谢大家了!问题解决了! :)
搞错了
页:
[1]