NumXL Software Development Kit (SDK)
Getting Started

In this tutorial, we cover the development configuration using Visual Studio 2012 for .Net and C/C++ development. If you use a different development tool, you can use the information here, but map the steps to match the UI of your development tool.

These steps and required files will vary significantly depending on your programming environment. So, we'll consider each separately.

For C/C++ custom application, you'll need to copy two set of files:

  • Header files (include)
  • Import libraries (lib)

Next, please click here to proceed to our tutorial section for developing custom application using C/C++ and NumXL SDK.

1. Compiler Dependency

The header files of NumXL SDK fully adhere to the ANSI standard C syntax. So in principle, any development tool with a compatible ANSI compiler can be used with NumXL SDK.

For the Import Libraries, the C/C++ SDK package already includes libraries files for Visual Studio 2010 and 2013 for 32 and 64-bit platforms.

Although, the included import libraries are readily usable in a wide range of development tools, we have included the module definition source files for the rare occasion where you may need to build your own libraries.

2. Directory Structure

To setup your development folders, we recommend the following structure:
  • numxl-sdk-c folder contains all files in the SDK.
  • output folder contains the executable binaries in NumXL and the SDK.
  • proj folder is where you maintain the source code for your custom application.

3. Compiler and linker Configurations

Go to the project folder (e.g., proj), create a new project:

  1. Project type: Visual C++ Projects → Win32 Console Application
  2. Open the new project, and click on "Project Properties" under .
  3. Open the project properties dialog, set the Configuration to "All Configurations", and platform to "All Platforms".
    • Project Configurations
      1. Select "General" from the left taskbar, and set the following: 
        • Output Directory: path to the SDK binaries executables (e.g. ....\output\)
        • Intermediate Directory: local path relative to your project (e.g. $(Platform))
      2. Next, under "C/C++" settings, select "General":
        • Additional Include Directories: path to NumXL SDK header files folder
      3. Under the linker settings, select "General":
        • Additional Library Directories: path to NumXL SDK import libraries folder (e.g. numxl-sdk-c\lib\VC100$(Platform))
        • Under the linker settings, select "Input":
        • Additional Dependencies: SFSDK.lib, SFLOG.LIB, SFLUC.LIB, SFDBM.LIB
      4. Click "OK" and close the project properties dialog box.

Source code

  1. In the main source file (e.g. TestApp.cpp), add the following header files: SFMacros.h, SFLogger.h, SFLUC.h, SFDBM.h, and SFSDK.h
  2. Then, initialize the SDK by calling NDK_Init.
    // The AppName must match the configuration file basename.
    // In this example, we must have HellpApp.conf in the output directory
    std::wstring szAppName(L"HelloApp");
    int nRet = NDK_Init(szAppName.c_str(), // we have HelloApp.conf
    NULL, // use the license key found in License.lic file
    NULL, // use the activation code in License.lic file
    NULL); // use the temp directory found in the current user's profile
    if (nRet == NDK_SUCCESS) {
    // Initialization successful
    } else {
    // Something went wrong
    }
    int __stdcall NDK_Init(LPCWSTR szBaseName, LPCWSTR szDataPath, long consoleAppTimeout, unsigned int *pClientToken)
    #define NDK_SUCCESS
  3. Finally, shut down the SDK by calling NDK_Shutdown to free resources.
    int nRet = NDK_Init(szAppName.c_str(), NULL, NULL, NULL, NULL);
    if (nRet == NDK_SUCCESS) {
    // Initialization successful
    nRet = NDK_Shutdown(); // Close log file and free all resources.
    }
    int __stdcall NDK_Shutdown(BOOL cleanup, unsigned int uClientToken)

Done! You may now use any NumXL SDK function as needed.

Remarks
  1. NumXL SDK APIs (arguments and behavior) are designed to match their counterpart NumXL worksheet functions as much as possible: (1) APIs are stateless, (2) robust, and (3) they can generate a wealth of logging information to help with issues raised during development and integration.
  2. In essence, the NumXL SDK exports its functions using C-API interface and reports its status via error codes as a return value.
  3. The caller application does not get passed any exception generated during the course of the function call.

See Also