[Quickfix-users] Unhandled exception in SessionSettings constructor
Brought to you by:
orenmnero
From: ying s. <sy8...@gm...> - 2008-01-29 13:20:19
|
Hi, all: I am new to QuickFix. I tested the library with the tutorial basic example, code is listed below. It builds and run in Visual Studio 2005. Command argument I give is arbitrary file name. It crashes on this line: FIX::SessionSettings settings(fileName); I get unhandled exception: access violation regardless what fileName is. Can anyone give me help on this? Thanks a lot *Source code:* #include "stdafx.h" #include "quickfix/SessionID.h" #include "quickfix/FileStore.h" #include "quickfix/FileLog.h" #include "quickfix/SocketAcceptor.h" #include "quickfix/Session.h" #include "quickfix/SessionSettings.h" #include "quickfix/Application.h" using namespace FIX; class MyApplication : public FIX::Application { public: ~MyApplication() {} public: virtual void onCreate(const SessionID &) {} virtual void onLogon(const SessionID &) {} virtual void onLogout(const SessionID &) {} virtual void toAdmin(Message &, const SessionID &) {} virtual void toApp(Message &, const SessionID &) throw (DoNotSend) {} virtual void fromAdmin(const Message &, const SessionID &) throw (FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon) {} virtual void fromApp(const Message &, const SessionID &) throw (FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType) {} }; int main( int argc, char** argv ) { try { if(argc < 2) return 1; std::string fileName = argv[1]; FIX::SessionSettings settings(fileName); MyApplication application; FIX::FileStoreFactory storeFactory(settings); FIX::FileLogFactory logFactory(settings); FIX::SocketAcceptor acceptor (application, storeFactory, settings, logFactory /*optional*/); acceptor.start(); // while( condition == true ) { do something; } acceptor.stop(); return 0; } catch(FIX::ConfigError& e) { std::cout << e.what(); return 1; } } |