From: Lars Broberg on
Ok,
It was a C-dll if I remember correctly?
Filip's response looks ok to me.
Regards
Lars Broberg
Elbe-Data AB
lars at elbe-data dot se


Lennart Bj?rk wrote:
> Lars,
>
> > Have you tried declaring "the string" as a psz?
>
> That was one of my first attempts that failed. In fact this is
> Clifford's problem, the one he asked us about last time we met, and he
> is too shy to ask here himself.
>
> But I did not test it exactly the way Filip proposes. I am about to test
> his way now.
>
> Lennart
From: Lennart Björk on
Filip,

> String are only working in vo. Try psz instead. :

I tried and changed everything to psz like

_dll function HEX_CRC32(pszInput as psz) as psz pascal:diCrEnc.HEX_CRC32

and my test-method to

method CRC_Test() class Shell
local pszInput as psz
local pszOutput as psz
local sOutput as string

pszInput := String2Psz("123456789")
pszOutput := HEX_CRC32(pszInput)

sOutput := Psz2String(pszOutput)

return

On the line
pszOutput := HEX_CRC32(pszInput)
it flips out with

Error Code: 50 [ ]
Subsystem: VO-CODE
Error Subcode: 5333
Argument Number: 2

I have always been very curious to meet 'Argument Number: 2'. He has
spoiled many of my programs. And now he is here without being asked for.

Lennart Bj?rk
From: Lennart Björk on
Malcolm Gray,

>
Do you have a C prototype for the function
<

The manual of the function does not say much about C, but there is


/* CRC-32 PROTOTYPE */
long _stdcall cHEX_CRC32(char *output, unsigned char *input, long in_len);

Note the lower-case letter 'c' preceding each name here to differentiate
from the functions in the Visual Basic interface. We have used the ANSI
standard char* and unsigned char* types here, but could have used the
Windows LPSTR and LPBYTE instead.


Lennart Bj?rk
From: Ronny Michiels on
Lennart,

Perhaps another version from see www.cryptosys.net ?
There it is called DICRYPTOSYS.DLL ...

-----
_DLL FUNCTION CRC_String(strInput AS STRING, nOptions AS LONG) AS LONG
PASCAL:DICRYPTOSYS.DLL.CRC_String
-----
LOCAL nResult AS LONG

? nResult:=CRC_String(PSZ("123456789"), 0) // Is the result HEX CBF43926 ?
? AsHexString(nResult) // Yes !
-----

Ronny.

Lennart Bj?rk wrote:
> Filip,
>
> > String are only working in vo. Try psz instead. :
>
> I tried and changed everything to psz like
>
> _dll function HEX_CRC32(pszInput as psz) as psz pascal:diCrEnc.HEX_CRC32
>
> and my test-method to
>
> method CRC_Test() class Shell
> local pszInput as psz
> local pszOutput as psz
> local sOutput as string
>
> pszInput := String2Psz("123456789")
> pszOutput := HEX_CRC32(pszInput)
>
> sOutput := Psz2String(pszOutput)
>
> return
>
> On the line
> pszOutput := HEX_CRC32(pszInput)
> it flips out with
>
> Error Code: 50 [ ]
> Subsystem: VO-CODE
> Error Subcode: 5333
> Argument Number: 2
>
> I have always been very curious to meet 'Argument Number: 2'. He has
> spoiled many of my programs. And now he is here without being asked for.
>
> Lennart Bj?rk
From: Ronny Michiels on
Lennart,

Another version (www.cryptosys.net) ?
Here it is called DICRYPTOSYS.DLL ...

-----
_DLL FUNCTION CRC_String(strInput AS STRING, nOptions AS LONG) AS LONG
PASCAL:DICRYPTOSYS.DLL.CRC_String
-----
METHOD TestPushButton() CLASS YourTestWindow
LOCAL nResult AS LONG

? nResult:=CRC_String("123456789", 0) // Is the result HEX CBF43926 ?
? AsHexString(nResult) // Yes
-----

Ronny.

Lennart Bj?rk wrote:
> Malcolm Gray,
>
> >
> Do you have a C prototype for the function
> <
>
> The manual of the function does not say much about C, but there is
>
>
> /* CRC-32 PROTOTYPE */
> long _stdcall cHEX_CRC32(char *output, unsigned char *input, long in_len);
>
> Note the lower-case letter 'c' preceding each name here to differentiate
> from the functions in the Visual Basic interface. We have used the ANSI
> standard char* and unsigned char* types here, but could have used the
> Windows LPSTR and LPBYTE instead.
>
>
> Lennart Bj?rk
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: And now the news from VODC Germany
Next: JPG to BMP