From: Lennart Björk on
Hello Everybody,

I have a nonVO dll with a function, HEX_CRC32(), that I try to use in a
VO-program. So far I get

Error Code: 50 [ ]
Subsystem: VO-CODE
Error Subcode: 5333
Argument Number: 2
CallStack:
SHELL:CRC_TEST (Line: 8)

Indeed very sad!

The manual of the nonVO function that I try to use says
>
HEX_CRC32 creates a hexadecimal CRC-32 checksum from a string of binary
values.
Syntax
Public Declare Function HEX_CRC32 Lib "diCrEnc.dll" (sInput As String)
As String

sOutput = HEX_CRC32(sInput)
Parameters
sInput String of binary data.
Returns
String containing an 8-character CRC-32 checksum in hexadecimal format.
Remarks
The input string can contain characters of any value between Chr(0) and
Chr(255). To find the CRC-32 checksum of a file, read the contents of
the file into a string first. A CR-LF pair (vbCrLf) is treated as two
separate bytes of value Chr(13) and Chr(10).
Example

Dim sInput As String
Dim sOutput As String

' Take a string we want to check
sInput = "123456789"
' Calculate CRC-32 checksum
sOutput = HEX_CRC32(sInput)
Debug.Print sOutput

This should result in output as follows:
CBF43926
<

In my VO-code I have my 'Public Declare Function HEX_CRC32' like
_dll function HEX_CRC32(sInput as string) as string pascal:diCrEnc.HEX_CRC32

and I try to use it in

method CRC_Test() class Shell
local sInput as string
local sOutput as string

sInput := "123456789"
sOutput := HEX_CRC32(sInput) // This is line 6
return


I am very grateful for comments that may help me to overcome this obstacle.

Lennart Bj?rk
From: Lars Broberg on
Hello Lennart!

Have you tried declaring "the string" as a psz?
You won't get a VO-string from a nonVO dll.

Regards
Lars Broberg

Lennart Bj?rk wrote:
> Hello Everybody,
>
> I have a nonVO dll with a function, HEX_CRC32(), that I try to use in a
> VO-program. So far I get
>
> Error Code: 50 [ ]
> Subsystem: VO-CODE
> Error Subcode: 5333
> Argument Number: 2
> CallStack:
> SHELL:CRC_TEST (Line: 8)
>
> Indeed very sad!
>
> The manual of the nonVO function that I try to use says
> >
> HEX_CRC32 creates a hexadecimal CRC-32 checksum from a string of binary
> values.
> Syntax
> Public Declare Function HEX_CRC32 Lib "diCrEnc.dll" (sInput As String)
> As String
>
> sOutput = HEX_CRC32(sInput)
> Parameters
> sInput String of binary data.
> Returns
> String containing an 8-character CRC-32 checksum in hexadecimal format.
> Remarks
> The input string can contain characters of any value between Chr(0) and
> Chr(255). To find the CRC-32 checksum of a file, read the contents of
> the file into a string first. A CR-LF pair (vbCrLf) is treated as two
> separate bytes of value Chr(13) and Chr(10).
> Example
>
> Dim sInput As String
> Dim sOutput As String
>
> ' Take a string we want to check
> sInput = "123456789"
> ' Calculate CRC-32 checksum
> sOutput = HEX_CRC32(sInput)
> Debug.Print sOutput
>
> This should result in output as follows:
> CBF43926
> <
>
> In my VO-code I have my 'Public Declare Function HEX_CRC32' like
> _dll function HEX_CRC32(sInput as string) as string
> pascal:diCrEnc.HEX_CRC32
>
> and I try to use it in
>
> method CRC_Test() class Shell
> local sInput as string
> local sOutput as string
>
> sInput := "123456789"
> sOutput := HEX_CRC32(sInput) // This is line 6
> return
>
>
> I am very grateful for comments that may help me to overcome this obstacle.
>
> Lennart Bj?rk
From: Filip Fransen on
Hi,

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

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

sOutput = psz2string(HEX_CRC32(string2psz(sInput)))


Filip

"Lennart Bj?rk" <lennart.bjork(a)bibserv.com> wrote in message
news:Fh_5h.22606$E02.9497(a)newsb.telia.net...
> Hello Everybody,
>
> I have a nonVO dll with a function, HEX_CRC32(), that I try to use in a
> VO-program. So far I get
>
> Error Code: 50 [ ]
> Subsystem: VO-CODE
> Error Subcode: 5333
> Argument Number: 2
> CallStack:
> SHELL:CRC_TEST (Line: 8)
>
> Indeed very sad!
>
> The manual of the nonVO function that I try to use says
> >
> HEX_CRC32 creates a hexadecimal CRC-32 checksum from a string of binary
> values.
> Syntax
> Public Declare Function HEX_CRC32 Lib "diCrEnc.dll" (sInput As String) As
> String
>
> sOutput = HEX_CRC32(sInput)
> Parameters
> sInput String of binary data.
> Returns
> String containing an 8-character CRC-32 checksum in hexadecimal format.
> Remarks
> The input string can contain characters of any value between Chr(0) and
> Chr(255). To find the CRC-32 checksum of a file, read the contents of the
> file into a string first. A CR-LF pair (vbCrLf) is treated as two separate
> bytes of value Chr(13) and Chr(10).
> Example
>
> Dim sInput As String
> Dim sOutput As String
>
> ' Take a string we want to check
> sInput = "123456789"
> ' Calculate CRC-32 checksum
> sOutput = HEX_CRC32(sInput)
> Debug.Print sOutput
>
> This should result in output as follows:
> CBF43926
> <
>
> In my VO-code I have my 'Public Declare Function HEX_CRC32' like
> _dll function HEX_CRC32(sInput as string) as string
> pascal:diCrEnc.HEX_CRC32
>
> and I try to use it in
>
> method CRC_Test() class Shell
> local sInput as string
> local sOutput as string
>
> sInput := "123456789"
> sOutput := HEX_CRC32(sInput) // This is line 6
> return
>
>
> I am very grateful for comments that may help me to overcome this
> obstacle.
>
> Lennart Bj?rk


From: Malcolm Gray on
Lennart Bj?rk wrote:
> Hello Everybody,
>
> I have a nonVO dll with a function, HEX_CRC32(), that I try to use in a
> VO-program. So far I get

> Public Declare Function HEX_CRC32 Lib "diCrEnc.dll" (sInput As String)
> As String
> In my VO-code I have my 'Public Declare Function HEX_CRC32' like

> _dll function HEX_CRC32(sInput as string) as string
> pascal:diCrEnc.HEX_CRC32

> I am very grateful for comments that may help me to overcome this obstacle.


Although VO has a type String and VB has a type string that does not
mean that are represented in memory in the same way.

Do you have a C prototype for the function (I don't do much with VB
and a quick google didn't confirm the right answer)
From: Lennart Björk on
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
 |  Next  |  Last
Pages: 1 2 3 4
Prev: And now the news from VODC Germany
Next: JPG to BMP