How to build your application with FIX Antenna .NET libraries
Samples at {path to FIX Antenna .NET package}\samples in FIX Antenna .NET package demonstate how to use FIX Antenna libraries.
To create a new application with FIX Antenna for Visual Studio 2010 follow the next instructions:
- Configuring project
- Create a new Console application project.
- Remove all default references except System
- Set manually platform target for application (x86 or x64).
The next steps describe the x64 case. - Add a reference FIXAntenna_net4.0.dll from package (Â {path to FIX Antenna .NET package}\lib\x64\FIXAntenna_net4.0.dll ).
Make sure that property Copy Local = true is set. Copy engine.properties file to your project from any of existing samples (or create it using "FIXAntenna .NET" — Programmer's Guide).
Note: you can add engine.properties to project and set Copy to Output directory = Copy if newer property or use absolute path.
Â
- Working with code:
- Declare the usage of com.b2bits.FIXAntenna namespace
- Call FixEngine.Create with a path to the engine. properties as parameters in your application statup code.
- Stop the engine before exiting the program
Example:
program.csusing
Âcom.b2bits.FIXAntenna;
Â
//...
Â
static
Âvoid
ÂMain(
string
[] args)
{
   Â
try
   Â
{
       Â
FixEngine.Create(
"engine.properties"
);Â Â
// engine initialization
       Â
// Your code
       Â
// ...
   Â
}
   Â
catch
Â(Exception ex)
   Â
{
       Â
Console.WriteLine(ex.ToString());
   Â
}
   Â
finally
   Â
{
       Â
FixEngine.Instance.Stop();
   Â
}
}
- Configure properties file:
Correct LicenseFile parameter in engine.properties. There should be absolute or relative path with filename to the license file.
Note:Â For Win32 platforms, the filename-separator character is "\\" or "/" in engine.properties
LicenseFile for samples in FIXAntenna .NET package configured to root of the package (i.e {path to FIX Antenna .NET package}\engine.license). Make sure that your copy license before run samples.Create directories logs and logs\backup in $(TargetDir) of your project.
These directories can be configured by parameters LogDirectory and BackupDirectory in engine.properties and should be created manually.Copy required V12-vc10-MD*-x64.dll from {path to FIX Antenna .NET package}\lib directory to $(TargetDir) of your project.
V12-vc10-MD-x64.dll for Release
V12-vc10-MDD-x64.dll for DebugÂ
Troubleshooting:
If application not working correctly look to logs\engine_XXXX.log for [ERROR] and [FATAL] notes.
- Make sure that your aplication uses opened ports.