PXR Family

Datasheet (PDF)

Manual & Guide

Application Notes

Driver Updates

Example Source Code

Compatible Image Processing Software

Product FAQ

All Frame Grabbers

Home Page


Feedback at:
CSinfo@cyberoptics.com or
1-800-366-9131

Borland Compiler Support Kit

The Imagenation PXR800 was not originally implemented with support for Borland compilers. Due to the strong interest in the Borland development environment after the PXR800's release, a Borland Compiler Support kit was developed to provide CyberOptics Semiconductor, Inc. customers with an alternative to the Microsoft Visual C++ development environment. The Borland Compiler Support kit is provided "as is" and on a "best effort" support basis only. The CyberOptics Semiconductor technical support group is not equipped to provide full Borland development environment support. However, every attempt will be made to answer all PXR800 related implementation questions.

The PXR800 application programming interface (API) is made up of two DLLs, pxr800.dll and pxrframe.dll. These DLLs are designed to be callable from the C programming language. They can also be used with C++, although they do not use any extra features of the C++ language. To use these DLLs they must be opened by a call to the imagenation_OpenLibrary function. This function loads the DLL and, in the case of pxr800.dll, asks the DLL to connect to the driver and detect any PXR800 frame grabbers installed in the system. In the past we have provided a library called ilib_32b.lib for the Borland compiler that contained the precompiled imagenation_OpenLibrary and imagenation_CloseLibrary functions.

Because the original PXR800 product was developed without Borland compiler support, this Borland Compiler Support Kit was developed. In place of providing full-blown Borland Libraries for every version of the Borland Compiler available, we have provided the source code for the imagenation_OpenLibrary and imagenation_CloseLibrary functions (ilib_32.c). Provided in this Borland Compiler kit is the source for the ilib_32 libraries which can be compiled into your Borland project. The ilib_32 source can be compiled to run with most previous versions of Borland compilers.

The following is an example of how to create and compile a project for the sample PXR_GRAB_RT2 program. The steps will be similar for the rest of the sample programs in the PXR sample directory.

  1. Open sample directory PXR_GRAB_RT2 and delete the following files. These are Microsoft specific and are not needed for Borland.

    PXR_GRAB_RT2.DSP
    PXR_GRAB_RT2.DSW
    DLG_MAIN.APS
    ILIB_32.LIB

  2. Now copy ilib_32.c and ilib_32.h to this directory.

  3. Under Borland create a new project for the PXR_GRAB_RT2 sample.

  4. After the project is created you'll need to delete any .ccp and .rc file from the project tree.

  5. Add all .c , .h, and .rc files to project from the project directory PXR_GRAB_RT2

  6. Comment out #include "afxres.h" in the dlg_main.rc file

  7. Add #include "ilib_32.h" to PXR_GRAB_RT2.c

  8. In the PXR frame grabber samples, we have decided to use two windows (one for control and one for video display). We found under Borland that there is a problem when making a call to the CreateDialog. It turns out that you must explicitly cast the parameter WndProc to DLGPROC .

    Make the following changes to PXR_GRAB_RT2.c.

    Change :

    hMainDlg = CreateDialog (hInstance, MAKEINTRESOURCE(IDD_GRAB),0, WndProc);

    to:

    hMainDlg = CreateDialog (hInstance, MAKEINTRESOURCE(IDD_GRAB),0, (DLGPROC)WndProc);

Now you should be ready to compile the PXR_GRAB_RT2 sample under Borland. On most versions you simple click on "Build All" under Project in the main menu. This may vary between compilers, so be sure to refer to your Borland compiler manual for the necessary steps to compile a project.