Products and Services- PenRight! Pro 3.x (DOS) - |
The C++ programming languages provide for cross-compatibility with C. That is, C and C++ routines and conventions can be used interchangeably in a C++ file (a file with a *. CPP extension).
In order to prevent a condition known as 'name mangling' during the link phase of a project build, a global variable 'C' must be declared. This can be easily accomplished by making a small modification to the PENRIGHT.H file located in the \PENRIGHT\INCS directory of your PenRight! Pro SDK.
If files are compiled using the C++ compiler, the compiler automatically defines a global variable __cplusplus. (Note the two underscores at the beginning.) In PENRIGHT.H you should test for the __cplusplus constant being defined and if it is defined, declare an extern 'C'.
The PENRIGHT.H file that is shipped with PenRight! Pro is as follows.
/*----------------------------------------------------------*/
/* PenRight! Pro Application Program Interface include file */
/*----------------------------------------------------------*/
/*----------------------------------------------------------*/
/* IMPORTANT NOTICE */
/* */
/* The data structures in the following include files */
/* require packing to the nearest byte. This is not */
/* necessarily the default used by your compiler! */
/* */
/* For Microsoft C 5.0 this is accomplished by use of the */
/* /Zp1 switch on the compiler command line or the */
/* #pragma pack(1) directive within the source code. */
/* */
/* For Turbo C 2.0 the compiler should be installed by */
/* TCINST with Alignment set to byte-aligning. This */
/* option is found within the Code Generation portion of */
/* the Compiler menu. */
/*----------------------------------------------------------*/
#ifndef __penright_h
#define __penright_h
#define __IN_PENRIGHT_H
#include <penapi.h>
#include <verbs.h>
#include <dcmapi.h>
#include <dbmapi.h>
#undef __IN_PENRIGHT_H
#endif /* __penright_h */
To make PenRight! Pro C++ compatible insert the following lines before the first #include statement.
#ifdef __cplusplus
/* for Borland and Microsoft C++ */
extern "C" {
#endif /* __cplusplus */
Then, insert the following lines after the last #include statement.
#ifdef __cplusplus
}
#endif /* __cplusplus */
The revised C++ compatible PENRIGHT.H should appear as follows.
/*----------------------------------------------------------*/
/* PenRight! Pro Application Program Interface include file */
/*----------------------------------------------------------*/
/*----------------------------------------------------------*/
/* IMPORTANT NOTICE */
/* */
/* The data structures in the following include files */
/* require packing to the nearest byte. This is not */
/* necessarily the default used by your compiler! */
/* */
/* For Microsoft C 5.0 this is accomplished by use of the */
/* /Zp1 switch on the compiler command line or the */
/* #pragma pack(1) directive within the source code. */
/* */
/* For Turbo C 2.0 the compiler should be installed by */
/* TCINST with Alignment set to byte-aligning. This */
/* option is found within the Code Generation portion of */
/* the Compiler menu. */
/*----------------------------------------------------------*/
#ifndef __penright_h
#define __penright_h
#define __IN_PENRIGHT_H
#ifdef __cplusplus
/* for Borland and Microsoft C++ */
extern "C" {
#endif /* __cplusplus */
#include <penapi.h>
#include <verbs.h>
#include <dcmapi.h>
#include <dbmapi.h>
#ifdef __cplusplus
}
#endif /* __cplusplus */
#undef __IN_PENRIGHT_H
#endif /* __penright_h */
Note:In Borland the -P compile switch can be used to force a C++ compile, even if the file has a *.C extension. The switch can be added in CodeStart-Options-Project-Compiler. For Microsoft, you should write a batch file that changes the CodeStart-generated source file with a *.C extension to a file that has a *.CPP extension, then call NMAKE.EXE. (The MAKEFILE will also need to be changed so it compiles the file with the *.CPP extension.
Users of the PenRight! Pro for DOS product will remember that you can edit the default settings of forms and their associated objects within DesignForm by selecting Defaults from the File Dropdown Menu.
You can also edit the default settings in PenRight! for Windows. You do this by editing the *.INI files that PenRight! installes in your \WINDOWS directory where you have Microsoft Windows installed. There are two initialization files that PenRight! installs: PENRIGHT.INI and PRWAPI.INI. PENRIGHT.INI contains the default settings for objects associated with forms as well as the directories where the Importer and Generator are located. PRWAPI.INI contains default settings for the forms themselves, such as the size of the form and related attributes.These are text files. They can be edited using any standard DOS editor.
Note: In order to see the changes you have made to PENRIGHT.INI and PRWAPI.INI, you must restart Windows.
Hardware Requirements
Software Requirements
Since the PenRight! Pro SDK is a PenRight! application, the PenRight! runtimes must be
installed before starting PenRight! Pro. By default, PENR!API.EXE and PENR!HWP.EXE install
at interrupts 60H and 61H, respectively. Your LIM 4.0-compatible EMS driver installs at
67H. Ensure that there are no conflicts with TSRs running concurrently with PenRight!.
If you need to change the default interrupts, the /i switch may be used when invoking the
runtimes. Valid interrupts range from 60H to 66H.
The PENRIGHT.BAT file in the PENRIGHT/BIN directory loads the runtime TSRs into memory at
the default interrupts and loads the code segments of the TSRs into EMS if EMS is enabled
and a LIM 4.0-compatible driver installed. This leaves approximately a small 40KB
footprint in conventional TPA memory.
You need approximately 475KB of conventional memory to successfully use the SDK. Run the
DOS MEM command to see how much conventional memory you have. If you do not have
sufficient conventional memory, load everything possible into upper memory (using the DOS
LH command). Alternately, you can use the DOS MEMMAKER.EXE utility or 386MAX to free
conventional memory. If you do, make sure to install for applications that need EMS.
AUTOEXEC.BAT
SET TEMP=C:\TEMP ECHO OFF PROMPT=$P$G PATH C:\DOS; C:\WINDOWS; C:\MSVC\BIN;C:\PENRIGHT\BIN;C:\UTIL; SET PENRIGHT=C:\PENRIGHT\BIN SET INCLUDE=C:\MSVC\INCLUDE;C:\MSVC\MFC\INCLUDE; C:\PENRIGHT\INCS; SET LIB=C:\MSVC\LIB;C:\MSVC\MFC\LIB; C:\PENRIGHT\LIBS; CHECKDISK/F CLS LH /L:2,56928 C:\WINDOWS\MOUSE..EXE /Y LH DOSKEY
CONFIG.SYS
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE RAM HIGHSCAN X=CC00-CFFF
FILES=60
DOS=UMB
STACKS=9,256
SHELL=C:\DOS\COMMAND.COM C:\DOS\ /e:1024 /p
DEVICE=NANSI.SYS
BUFFERS=10,0
PENRIGHT
. This prevents Windows from corrupting the runtimes when it is loading.
Questions or Comments? |
Email to: temple@penright.com |
|Text version of this page| �Copyright 1998 PenRight! Corporation