我需要你的帮助这是GetDispInfo函数中的运行时错误。 [英] I need your help This is runtime error in GetDispInfo function.

查看:97
本文介绍了我需要你的帮助这是GetDispInfo函数中的运行时错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

这是我的代码



  class  CContactList: public  CListCtrl {..} 


void CContactList :: GetDispInfo(...){
...
...
...
if (nItem> m_listContacts-> GetCount() - 1 // AAAAAAAA
...
}



Plz查看AAAAAA

 CPtrArray * m_listContacts;   * .h文件



我已格式化变量

 m_listContacts =& m_Array;  //  在其他班级 





但是get_ispInfo函数中的m_listcontacts变量为NULL。



请帮助我。

解决方案

< blockquote>如果你的值为null,那么它可能根本没有设置(或者你设置它的值也是null)。



你可能需要检查用于设置m_listContacts的代码:检查您是否设置了正确的实例值,而不是新实例。



首先查看该代码,如果不是很明显,那么使用调试器来确切地确定yoiu将其设置为什么值。



但我们不能为你做到这一点!

Hello
This is my Code

class CContactList: public CListCtrl{..}


void CContactList::GetDispInfo(...){
   ...
   ...
   ...
   if(nItem > m_listContacts->GetCount()-1)  //  AAAAAAAA
      ...
}


Plz view AAAAAA

CPtrArray *m_listContacts;  in *.h file


and I already formatted variable

m_listContacts = &m_Array; // in other class



but m_listcontacts variable is NULL in GetDispInfo function.

plz help me.

解决方案

If your value is null, then it probably hasn't been set at all (or the value you are setting it to is null as well).

You probably need to check the code you use to set the m_listContacts: check that you are setting the right instance value, and not a new instance.

Look at that code first, and if it isn't obvious then use the debugger to check exactly what value yoiu are setting it to.

But we can't do that for you!


这篇关于我需要你的帮助这是GetDispInfo函数中的运行时错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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