对于Windows7,get_tables函数不能正常工作,但对于XP,它却可以工作. [英] get_tables function is not working correctly for windows7 but for XP it is working.

查看:107
本文介绍了对于Windows7,get_tables函数不能正常工作,但对于XP,它却可以工作.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..
我在遇到问题时粘贴了代码行.



当我在XP中调试代码(粘贴在下面)时,get_tables(& _result)将表列表分配给_result并且hr的值变为S_OK,但是如果我尝试使用Windows7(32位)的相同代码,则get_tables函数将分配NULL(0X00000) )_result ...的值(不排除),hr的值变为 该应用程序调用了为不同线程编组的接口" 然后我的应用程序得到了坠毁...
为什么Windows7(32位)会发生这种情况..
我应该去编组线程吗?
我需要更改win7的某些设置..
请咨询...
在此先感谢..

Hi all..
i am pasting line of code where i am getting problem.



when i debug code(pasted bellow)in XP ,get_tables(&_result)assign list of tables to _result and value of hr becomes S_OK,but if same code i try with windows7(32 bit),get_tables function is assigning NULL(0X00000) Value to _result...(that is not excepted)and value of hr becomes"the application called an interface that was marshalled for different thread" then ofter my application gets crashed...
why it is happening for windows7(32 bit)..
should i go for marshalleing thread???
or i need to change some settings for win7..
pls advice...
thanks in advance..

// Append the new table
        m_pCatalog->Tables->Append(_variant_t((IDispatch *) pTableNew));





在调试时,我要注意这一点(请参见下面的内容)

内联TablesPtr _Catalog :: GetTables(){
结构表* _result;
HRESULT _hr = get_Tables(& _result);
如果(FAILED(_hr))_com_issue_errorex(_hr,this,__uuidof(this));
return TablesPtr(_result,false);
}





While debugging i go this point(see bellow)

inline TablesPtr _Catalog::GetTables ( ) {
struct Tables * _result;
HRESULT _hr = get_Tables(&_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return TablesPtr(_result, false);
}

推荐答案

XP没有这么好的访问权限控制,因此几乎所有东西都可以使用.检查两个线程的线程模型,它们应该与编组类型相同.
XP has no such fine access right control, so almost every thing works. Check the threading models of both threads, they should be the same as the marshalling type.


这篇关于对于Windows7,get_tables函数不能正常工作,但对于XP,它却可以工作.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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