gpt4 book ai didi

c++ - 单独线程中的 Qt 给出 :First-chance exception at 0x74f2c41f infoo . exe: 0x000006A6: 绑定(bind)句柄无效

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:29:34 24 4
gpt4 key购买 nike

我尝试在单独的线程中运行名为“Dispatcher”的 QObject 继承类,该类使用 QtWebKit 函数。
然后是主 GUI 线程,但是当我初始化对象时,我得到:

First-chance exception at 0x74f2c41f infoo .exe: 0x000006A6: The binding handle is invalid

对象中的 Signal 和 Slots 不起作用,它们确实返回 true 但从未被调用。我猜它与我看到的错误有关。根据互联网,我需要像这样开始新线程:

CollectorWorker* pCollectorWorker = new CollectorWorker(pUrlStack,m_pSettings);
pCollectorWorker->moveToThread( QApplication::instance()->thread());
QCoreApplication::postEvent(pCollectorWorker, new QEvent( QEvent::User ) );

其中 CollectorWorker 是初始化 Dispatcher 类的独立线程对象。当我初始化 Dispatcher 类时,我遇到了这个错误。

CollectorWorker.cpp

bool CollectorWorker::event( QEvent *ev )
{
if( ev->type() == QEvent::User )
{
Dispatcher dispatcher; // here im getting the error.
return true;
}
return false;
}

最佳答案

0x000006A6代表RPC_S_INVALID_BINDING

来自 http://blogs.msdn.com/b/greggm/archive/2006/01/04/509243.aspx

Explaining 'The Binding Handle Is Invalid'

Today I want to try to give more insight into the 'Binding Handle IsInvalid' problem that a number of people have reported with the VS2005 debugger.

First, if all you care about is how to solve the problem: Enable the'Terminal Services' service and reboot. If you want to know more, readon.

The Terminal Services service

I have seen many users say somethinglike "I don't want to enable the Terminal Services service becauseit’s a security risk". While I certainly understand this fear, thisstems from a misunderstanding of what the Terminal Services serviceprovides.

Enabling the Terminal Services service does NOT automatically enableRemote Desktop. If you want Remote Desktop disabled, then uncheck theremote desktop checkbox on the Remote tab of the properties dialog forMy Computer. By default, Remote Desktop is disabled on Window XP, sounless you have gone and enabled it, it should already be disabled onyour computer.

So, why is this service enabled by default? The Terminal Servicesservice is enabled by default because in addition to the RemoteDesktop functionality, it also provides for Remote Assistance, FastUser Switching, process listing, DCOM support, and probably lots ofother stuff that I don't know about because I don't work on the TSteam. If you are running with the Terminal Services service disabled,then you are running in a strange and not recommended configuration.You also have a broken Task Manager, and probably a bunch of otherthings that directly or indirectly rely on this service.

So please, regardless of what you want to do with Visual Studio, don'tdisable this service.

关于c++ - 单独线程中的 Qt 给出 :First-chance exception at 0x74f2c41f infoo . exe: 0x000006A6: 绑定(bind)句柄无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13987610/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com