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

求助高手!

程序中我有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()));
...............................................
                                          .................................................
    }

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

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

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

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

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

type == "parallel"
改为
strcpy(type,"parallel")
type == "aclinic"
改为
strcpy(type,"aclinic")

就可以了

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

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

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

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();
......
    }

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

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

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

:)
搞错了
页: [1]
查看完整版本: 求助高手!