MFC中的对话框数组 [英] dialog arrays in mfc

查看:324
本文介绍了MFC中的对话框数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CArray<CDialog, CDialog&> dlg;
dlg.SetSize(10);
....
dlg.RemoveAt(5);



共有10个对话框.如果我使用CArray :: RemoveAt()删除最后一个,则效果很好.
但是,如果执行上述操作,那么如果我尝试转到索引大于5的对话框,它将无法正常工作.
如何解决呢?
预先感谢.



There are 10 dialogs in total. If I delete the last one using CArray::RemoveAt(), it works well.
But if I do the above, then it won''t work if I try to go to the dialogs with an index greater than 5.
How to solve this?
Thanks in advance.

推荐答案

hi 你有十个对话框
您使用常量索引删除了array.我的意思是五个:dlg.remove(5)

肯定是我的朋友
当您执行五次时,您有五个数组,再执行一次,您将拥有少于五个数组,并且您将没有数组编号5来删除它.
我对吗?
hi you have ten dialog
you used constant index to remove array . i mean five : dlg.remove(5)

it''s certain my pal
when you perform it for five times, you have five array and once you do it again, you''ll have less than five array and you won''t have array number 5 to remove that.
am i right?


这篇关于MFC中的对话框数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆