How to include Price History API in C++?

From FxCodeBaseWiki
Jump to: navigation, search

The section describes how to include Price History API in C++ on different platforms to your application.

Details

Win32

To use Price History API in your C++ application on Win32, you should:

1. Place your application program in the same directory where supporting dlls are located (usually the bin folder containing gsexpat.dll, pricehistorymgr.dll, gstool3.dll, etc.) For example, if folder C:\Program Files\Candleworks\PriceHistoryAPI\bin contains these libraries, post-built event command line can look like this:

copy "C:\Program Files\Candleworks\PriceHistoryAPI\bin\*.dll" "$(TargetDir)"

Alternatively, you can build you application in the directory containing supporting dlls.

2. Add the include subfolder of the directory where Price History API is installed to additional include directories of the project. So if Price History API is installed to C:\Program Files\Candleworks\PriceHistoryAPI, add the directory C:\Program Files\Candleworks\PriceHistoryAPI\include\pricehistorymgr as additional include directory.

3. Add lines:

#include <windows.h> 
#include "pricehistorymgr/pricehistorymgr.h"

to file stdafx.h.

4. Add lib subfolder of the directory where Price History API is installed to additional library directories of the project. So if Price History API is installed to C:\Program Files\Candleworks\PriceHistoryAPI, add the directory C:\Program Files\Candleworks\PriceHistoryAPI\lib as additional library directory. Add pricehistorymgr.lib as additional dependency for the linker input.

Note: Price History API interfaces uses multi-byte strings so Character Set of Configuration Properties will be "Use Multi-Byte Character Set".

Linux/MacOS

To use Price History API in your C++ application on Linux or MacOS, you should:

1. Place supporting shared libraries in the same directory where your application program is located. Alternatively, you can place supporting shared libraries in the /usr/lib directory.

Add libpricehistorymgr to the list of libraries in the linker options. For example, if you use gcc, the option will be -lpricehistorymgr. The path to the directory containing the libraries (e.g. /PriceHistoryAPI/lib) can be specified by the -L/PriceHistoryAPI/lib option.

3. Include the header file in your code using the directive #include "pricehistorymgr/pricehistorymgr.h". The path to the directory containing the headers (e.g. /PriceHistoryAPI/include/pricehistorymgr) can be specified by the -I/PriceHistoryAPI/include/pricehistorymgr option.

Price History API dependencies

If you use the Price History API, exactly the same kinds of libraries of the ForexConnect API and the Quotes Manager API must be added to the application, even if you do not use or are not going to use them directly.


This Article in Other Languages

Language: English  • español