gpt4 book ai didi

c++ - QuickFIX 和 MFC : cannot login using Initiatior. logon() 函数

转载 作者:行者123 更新时间:2023-11-28 05:32:40 24 4
gpt4 key购买 nike

我正在开发一个 GUI 应用程序,我试图将 QuickFIX 库集成到 MFC 中。我已经成功添加了所有需要的库和包含,但是,当我尝试使用 logon() 函数进行连接时,我遇到了麻烦。首先,引擎开始要求配置文件中的更多字段,而在控制台应用程序中它并不关心这些字段。其次,在登录请求后,我收到“调试断言失败!程序:C:\Windows\System32\MSVCP120D.DLL 文件:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree线路:327表达式:映射/设置迭代器不兼容”。我想做的是如下:我有一个菜单。如果您在菜单中按“开始”,我将 bool 标志设置为 true。在我的 OnKickIdle 函数中(应用程序是基于对话框的)我检查这个标志,如果它被设置 - 我开始正常启动 SockeInitiator。一切正常,直到我调用 logon() 函数,并且在调用之后 - 抛出调试断言。这是 CallStack 输出:

msvcp120d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 15 C++ OKKOIN_BOT.exe!std::_Tree_const_iterator > > >::operator==(const std::_Tree_const_iterator > > > & _Right) Line 327 C++ OKKOIN_BOT.exe!std::_Tree_const_iterator > > >::operator!=(const std::_Tree_const_iterator > > > & _Right) Line 341 C++ OKKOIN_BOT.exe!FIX::SocketInitiator::onTimeout(FIX::SocketConnector & __formal) Line 227 C++ OKKOIN_BOT.exe!FIX::SocketInitiator::onStart() Line 93 C++ OKKOIN_BOT.exe!FIX::Initiator::startThread(void * p) Line 286 C++ [External Code]

是否有人遇到过同样的问题并尝试将 QuickFIX 集成到 MFC 中?非常感谢你们。这也是我的 OnKickIdle() 函数的一部分:

LRESULT COKKOIN_BOTDlg::OnKickIdle(WPARAM wparam, LPARAM lparam)
{
if (b_startFlag)
{
std::string filepath = "quickfix-client.cfg";
FIX::SessionSettings settings(filepath);
Application app(settings);
FIX::FileStoreFactory storefact(settings);
FIX::ScreenLogFactory logfactory(settings);
FIX::SocketInitiator initiator(app, storefact, settings, logfactory);
b_initflag = TRUE;
//initializing the needed variables
initiator.start(); //use poll instead
Sleep(2000);
if (initiator.isLoggedOn())
{
MessageBox(L"Logged On", L"Information", MB_OK | MB_ICONINFORMATION);
}
else
{
MessageBox(L"Not Logged On", L"Information", MB_OK | MB_ICONINFORMATION);
}
}
return FALSE;
}

最佳答案

我终于找到了问题所在。 MFC 本身的问题是因为它不支持 QuickFIX 所需的 Windows Sockets 2。我想这个问题可以结束了。

关于c++ - QuickFIX 和 MFC : cannot login using Initiatior. logon() 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39084852/

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