CustomDraw ListCtrl似乎返回垃圾 [英] CustomDraw ListCtrl seems to return rubbish
问题描述
我刚刚在旧计算机上安装了一台运行XP的新PC,该计算机的版本为MSVC ++.NET(2002).
我对前一阵子编写的软件负载进行了更改,并且大多数都可以正常工作.一个程序似乎已经编译了各种各样的问题,我已经解决了大多数问题,但是只有一个我无法解决.这是我的代码,它落在GetItemData上(dwItemSpec的值为2083377472)
Hi,
I have just installed a new PC running XP with the version of MSVC++.NET (2002) I had on my old machine (which I have now stupidly uninstalled).
I have made changes to loads of software I wrote a while back and most of it works fine. One program seems to have had all sorts of problems compiling, I have ironed most of them out but there is just one I can''t get my head around. Here is my code, it falls over on the GetItemData (dwItemSpec has a value of 2083377472)
void CImageDlg::OnNMCustomdrawListbrandproperties(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<nmlvcustomdraw>;(pNMHDR);
int i = m_brandLocationList.GetItemData((int)pLVCD->nmcd.dwItemSpec);
BPDATA bp = m_arrBP.GetAt(i);
ColourListBox(m_brandLocationList, pNMHDR, pResult, bp.cr);
}
出现的错误是...
"Unhandled exception at 0x7c90120e in AuditEnquiry.exe: User breakpoint".
在此先感谢
The error it comes up with is...
"Unhandled exception at 0x7c90120e in AuditEnquiry.exe: User breakpoint".
Thanks in advance
推荐答案
来自 ^ ]:
From MSDN[^] :
类型:DWORD_PTR
项目编号.该成员中包含的内容将取决于发送通知的控件的类型.有关特定控件的信息,请参阅NM_CUSTOMDRAW通知参考,以确定该成员中是否包含 .
Type: DWORD_PTR
The item number. What is contained in this member will depend on the type of control that is sending the notification. See the NM_CUSTOMDRAW notification reference for the specific control to determine what, if anything, is contained in this member.
您确定在您的上下文中它必须具有有意义的值吗?
Are you sure, in your context, it must have a meaningful value?
这篇关于CustomDraw ListCtrl似乎返回垃圾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!