m_viewList.GetHead()可在Win7& WinXP的 [英] m_viewList.GetHead() working in Win7 & WinXP

查看:58
本文介绍了m_viewList.GetHead()可在Win7& WinXP的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有人可以帮我找到有关此工作原理的更多详细信息吗:((CEditView*)m_viewList.GetHead()).我找不到有关如何维护viewList的详细信息.

Windows XP和Windows-7 [不确定Vista]之间似乎有所改变.此功能.我正在使用VC2005.我在Windows7中看到了:

((CEditView*)m_viewList.GetHead())->SerializeRaw(ar); 无法在Windows7中编写任何内容.原因是:
((CEditView*)m_viewList.GetHead())->LockBuffer(); 返回一个空字符串,bufferLength为1 [我认为行字符的结尾].

不过,它们在WindowsXP上可以正常工作.因此,我认为某些事情一定已经改变了. viewList的维护方式.

预先感谢,
Shishir

Hi,

Can some one please help me find more details about how this works : ((CEditView*)m_viewList.GetHead()). I couldn''t find much details about how viewList is maintained.

It seems like something has changed between Windows XP and Windows-7 [not sure of Vista] w.r.t. this functionality. I am using VC2005. I see in Windows7 that :

((CEditView*)m_viewList.GetHead())->SerializeRaw(ar); fails to write anything in Windows7. The reason being :
((CEditView*)m_viewList.GetHead())->LockBuffer(); returns an empty string and bufferLength being 1 [end of line character I presume].

Though, they work fine on WindowsXP. Hence, I am thinking something must have changed w.r.t. how the viewList is maintained.

Thanks in advance,
Shishir

推荐答案

大概m_viewList是某种包含CEditView的MFC列表.查看您正在使用的类的MSDN文档,以查看最近是否有任何更改.您也可以尝试将代码分解为各个组成部分,因此不必编写:
Presumably m_viewList is some type of MFC list containing CEditViews. Take a look at the MSDN documentation for the class you are using to see if anything has changed recently. You could also try breaking your code down into its constituent parts, so instead of writing:
((CEditView*)m_viewList.GetHead())->LockBuffer();


你有类似的东西:


you have something like:

CEditView* pView = m_viewList.GetHead();
pView->LockBuffer();


然后通过调试器运行它以查看所接收的值.


Then run it through your debugger to see what values you are receiving.


这是一个非常疯狂的猜测,但这可能是权限问题.可能与UAC有关.要进行检查,请以管理员身份运行您的应用,以查看问题是否消失.
This is a very wild guess, but it could be a permissions issue. And possibly UAC related. To check that out, run your app as Administrator to see if the problem goes away.


LPCTSTR lpszText = ((CEditView*)m_viewList.GetHead())->LockBuffer(); // misnomer !!


尝试将其分解为各个组成部分,以便您可以在每个阶段看到结果,例如:


Try breaking this down into its constituent parts so you can see the results at each stage, such as:

LPCTSTR lpszText;
CEditView* pView;
pView = (CEditView*)m_viewList.GetHead();
lpszText = pView->LockBuffer();


在每一点上,您都应该能够检查变量的内容,以检查它们是否符合您的期望.

我也对您的意思是"//misnomer !!"


At each point you should be able to inspect the content of the variables to check that they are as you expect.

I''m also interested in what you mean by "// misnomer !!"


这篇关于m_viewList.GetHead()可在Win7& WinXP的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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