[futurebasic] Re: converting HASP function to fb3

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2003 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Fri, 9 May 2003 11:27:55 -0400
In this thread, Robert Purves explained:

>1. Without knowing the definition of DWORD in the HASP header files,
>one can only guess at the conversion of DWORD IdNum, but it is not
>likely to be unsigned word.
>
>2. The correct conversion for C's int is to FB's long. Replace every
>int by long.


Thanks for the direction, Robert.

I went to the HASP site:

http://www.ealaddin.com/support/hasp/vendor.asp#macusb

Downloaded "RUS Mac OS X" for vendors.

Opened the "hasprus.h" header and found DWORD defined as an unsigned
long. The header includes only two current functions. This
translation into FB^3 should be getting closer. Too bad the example
files are C++. (Beware of lost underscores on the Associate server):

library "haspdev_carbon.shlib"

#define DWORD as unsigned long
#define void  as long

toolbox fn RUS_CreateUpdateDirect(¬
        DWORD                IdNum,¬
        long             Password1,¬
        long             Password2,¬
        long               KeyType,¬
        long               Address,¬
        long    NumofBytesToUpdate,¬
        char         * MemoryImage,¬
        long        CodeBufferSize,¬
        char                * Code,¬
        void                * skey ) = long

toolbox fn RUS_CreateUpdateFAS(¬
        DWORD             idnum,¬
        long              pass1,¬
        long              pass2,¬
        long            keyType,¬
        long          moduleNum,¬
        long        activations,¬
        long               year,¬
        long              month,¬
        long                day,¬
        long           stations,¬
        long     codeBufferSize,¬
        char             * code,¬
        void             * sKey ) = long

library

Ken