0

I want to initialize a QuickFix initiator and I used the following code:

ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize start");
std::string filename = "FileSettings.cfg";//cfgFileName
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize filename");
FIX::SessionSettings settings(filename);
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize settings");
FIX::FileStoreFactory storeFactory(settings);
FIX::ScreenLogFactory logFactory(settings);
_socketInitiator = new FIX::SocketInitiator(*this, storeFactory, settings, logFactory);
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize true");

It works inside the debugger but, when I try to use it inside an executable (I'm working on Windows) the .exe file crashes after the line:

FIX::SessionSettings settings(filename);

My QuickFix configuration file is:

[DEFAULT]
ConnectionType=initiator
HeartBtInt=30
ReconnectInterval=1
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=N
SocketConnectHost=127.0.0.1


[SESSION]
BeginString=FIX.4.2
SenderCompID=123
TargetCompID=Coinbase
SocketConnectPort=4198
DefaultApplVerID=9
ResetOnLogon=Y
Password=password
DataDictionary=FIX42.xml

What is happening?

JimmyNJ
  • 1,134
  • 1
  • 8
  • 23
SMax23
  • 11
  • 2
  • 1
    Don't you have a crash log of some kind? Otherwise it is only guesswork. – Christoph John Jun 16 '21 at 10:16
  • `00000065`bcd6f300 00007ff6`5fcfcdae : 000001e6`d337b6c0 00000065`bcd6f6a8 00000065`bcd6f6a8 cccccccc`cccccccc : SampleGateway64!FIXExchangeAPI::initialize+0x9e 00000065`bcd6f680 00007ff6`5fd6bfbe : 000001e6`d3985700 000001e6`d3987560 cccccccc`cccccccc cccccccc`cccccccc : SampleGateway64!CGateway::Initialize+0xee` – SMax23 Jun 16 '21 at 10:42
  • Last in call stack: `00000065`bcd6be80 00007ffa`665d10bd : 00000065`bcd6bf90 00000065`bcd6bf88 00000000`00000024 cccccccc`cccccccc : ucrtbased!__crt_stdio_output::output_processor,__crt_stdio_output::format_validation_base > >::process+0x114` – SMax23 Jun 16 '21 at 10:43
  • `ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s. EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s. EXCEPTION_CODE_STR: c0000005` – SMax23 Jun 16 '21 at 10:49
  • Did you check this? https://stackoverflow.com/a/17169463/4962355 – Christoph John Jun 16 '21 at 13:07
  • I am logging, because program crashed ,if a don't do it ,programm was crashed does not matter. If you mean problem with log? – SMax23 Jun 16 '21 at 14:21
  • Now i am using .exe release mode and it works ok, but .exe mode Debug it crushed, i don't understand that – SMax23 Jun 16 '21 at 15:00
  • I solved my problem, app don't see cfg file, i set full path and it works – SMax23 Jun 16 '21 at 15:20

0 Answers0