Portal API Programming Language Instructions

C/C++

To use the Portal API from C or C++, regardless of your operating system, you must #include the wecrd.h file into your source code.  This header gives you a function declaration for each function in the API.  It also defines constants for error codes, card models, and other constant values.
Example:  At the top of your C or C++ source file which uses the Portal API functions or constants, you should have this line:

#include "wecrd.h"

Make sure that you have the wecrd.h file in the same directory as your source file or in the include directory for your compiler.
Also, if you have not yet installed the Portal API library, see the installation page for instructions.

Compiling and Linking on Windows:
In short, you must instruct your compiler to link with the WeCrd.lib file that is provided in the "win/c_c++" directory of the Portal distribution (it is usually easiest to copy it into your project directory first). Specific compiling procedures vary depending on what compiler you are using.  In Microsoft Visual Studio C++, this is done by adding WeCrd.lib to the list of libraries in the Link section of the Project Settings / Project Properties.  For example, in Visual Studio .NET, open the Project Properties and navigate to Configuration Properties -> Linker -> Input, and enter "WeCrd.lib" in the "Additional Dependencies" box.

If you are using a Borland C/C++ compiler, you will need to link your project with the bWeCrd.lib file instead. As a general tip for Borland users, Microsoft format (COFF) .lib files can be converted to Borland's format (OMF) using Borland's COFF2OMF utility, for example:

COFF2OMF -lib:st WeCrd.lib bWeCrd.lib

If ever necessary, a Borland format .lib file can be created directly from a DLL, for example:

implib bWecrd.lib WeCrd.dll

Compiling and Linking on Linux:
When you compile your source files, you must link with the wecrd.a library file.  It is usually easiest to copy the wecrd.a file into the same directory as your source files.  Then, compile your program with a command similar to the following:

gcc myfile.c wecrd.a

Or

g++ myfile.cc wecrd.a

where myfile.c or myfile.cc is a source file you want to compile.

The wecrd.a file is a static library.  This means that after you have compiled your program, your program is not dependent on the wecrd.a library file.  This also means that if you obtain a new version of the Portal API, you will need to recompile your program.
 

Visual Basic

In order to access the Portal API functions from Visual Basic, you must simply include a module in your project that declares the functions and constants of the API. Once the appropriate module has been included in your project, you will have access to all of the API functions such as we_OpenCard, etc.  You can then simply compile your program. 

Copyright 2004 Winford Engineering.