PBNotes  12/13/2000
===================

The declarations in this PowerBASIC PB/DLL version were
converted from the appropriate C/C++ header files using
the following conversions:

C/C++            PowerBASIC
---------        ----------
char             ASCIIZ or BYTE (?) as required
short            INTEGER (%)
float            SINGLE (!)
double           DOUBLE (#)
BYTE             BYTE (?)
WORD             WORD (??)
DWORD            DWORD (???)
long             LONG (&)
int              LONG (&)
UINT             LONG (&)
BOOL             LONG (&)
LRESULT          LONG (&)
LPARAM           LONG (&)
HWND             LONG (&)
HMENU            LONG (&)
HCURSOR          LONG (&)
HINSTANCE        LONG (&)

vbool            INTEGER (%)   C/C++ VCType32.h
UID              DWORD (???)   C/C++ VCType32.h
ENTITYHANDLE     LONG (&)      C/C++ VCType32.h
WORLDHANDLE      LONG (&)      C/C++ VCType32.h
GRAPHICHANDLE    LONG (&)      C/C++ VCType32.h

Handles, LParam, WParam, LResult, HResult and UINT are defined
as LONG to match typical Win32 calls as defined in Win32API.inc.
Note that some Visual Cadd API calls require Wparam AS WORD for
some calls, to maintain compatibility with 16-bit Windows.


'Color', 'Left', 'Right', 'Port', "Parity', 'Str'
are reserved words in PB/DLL.  Data names used in these SDK
files have been adjusted accordingly.

The C/C++ procedures that pass UDTs 'by value' are supported.
Individual elements of the UDTs (Point2D, etc.) can be passed
BYVAL to the C/C++ procedures as long as the PB/DLL limit of
16 parameters passed is not exceeded in the parameter list.
UDTs can be returned from the C/C++ functions by declaring
the procedure as a SUB and then passing the UDT 'by reference'
as the first item in the parameter list.  For example:

extern "C" Point2D WINAPI VCGetGridOrigin(short* iError);
DECLARE SUB VCGetGridOrigin (pRet AS Point2D, iError AS INTEGER)

Note that parameters are passed 'by value' by default with
C/C++, where the default with PB/DLL is 'by reference'.
Parameters are defined 'datatype dataname' with C/C++, but
are defined 'dataname AS datatype' with PB/DLL.


PowerBASIC PB/DLL is a 16-bit application and requires source
files to be 16-bit convention (short names).  Long file names
can be used within your applications, however.

PB/DLL is NOT case sensitive, but C/C++ IS case sensitive.
This requires the ALIAS option to create the proper case for
C/C++ DLLs.

SDECL and it's synonym STDCALL specifies that the declared
procedure uses the "Standard Calling Convention".  With an
SDECL procedure, parameters are passed on the stack right
to left.  This is the default for PB/DLL and needs not to be
specified in the declarations.

The current PB/DLL IDE editor has an approximate limit of
16,000 lines per file.  Where this may case a problem, two
files have been used (VCMain_1.bas, VCMain_2.bas, etc.).

The PB/DLL data type 'AS ANY' disables type checking for a
given parameter and passes the full 32-bit address of the
variable passed.  This is reported to cause a compiler error
at times and has been replaced with 'BYVAL AS DWORD' to 
specifically declare a DWORD type for this address (pointer).
Use 'BYVAL MyDataPointer' or 'BYVAL VARPTR(MyData)'

The #REGISTER DEFAULT metastatement has been known to possibly
cause problems when calling certain C/C++ procedures.  It is
recommended to use a #REGISTER NONE metastatement.  It must
precede all executable code and must not be located within a
Sub or Function.  #REGISTER NONE disables the automatic
assignment of register variables.  You can still use the
REGISTER statement to explicitly define register variables
on an individual basis.  See PB/DLL documentation for details.

The pre-defined string equates are not documented
in the HELP file:

Equate  Value        Meaning
-------------------------------------------------
$NUL    CHR$(0)      NUL
$BEL    CHR$(7)      Bell
$BS     CHR$(8)      Backspace
$TAB    CHR$(9)      Horizontal Tab
$LF     CHR$(10)     Line Feed
$VT     CHR$(11)     Vertical Tab
$FF     CHR$(12)     Form Feed
$CR     CHR$(13)     Carriage Return
$CRLF   CHR$(13,10)  Carriage Return & Line Feed
$EOF    CHR$(26)     End of File
$ESC    CHR$(27)     Escape
$DQ     CHR$(34)     Quotation mark


It has been found that the RESET statement in the initial
release of PB/DLL 6.0 does NOT reset a scalar variable
when used as:

RESET variable

Test before using, or contact PowerBASIC concerning an update.
