Ive put together a little DLL in PB simply to create a CRC32 hash based on the CRC32 code floating around this forum. I can call it easily from PB, but I need to also call it from a VB app...
Here is the function exported from the PB DLL:
Here is how I call it in PB:
Ive been trying for the last few hours to call it from VB, but none of my combinations have worked.
It seems straight-forward enough, just need to crack the combination! Any ideas anyone?
[This message has been edited by Wayne Diamond (edited August 31, 2001).]
Here is the function exported from the PB DLL:
Code:
FUNCTION CRC32HASH (BYVAL ptrBuffer AS DWORD, BYVAL lenBuffer AS LONG, szReturn AS LONG) EXPORT AS LONG
Code:
#COMPILE EXE #INCLUDE "win32api.inc" DECLARE FUNCTION CRC32HASH Lib "pbcrc32.dll" ALIAS "CRC32HASH" (BYVAL ptrBuffer AS DWORD, BYVAL lenBuffer AS LONG, szReturn AS LONG) AS LONG FUNCTION PBMAIN() AS LONG ON ERROR RESUME NEXT Dim MyString As String Dim ResultCrc AS Long MyString = "Test" & CHR$(0) & "Test" 'Note - cant use ASCIIZ, as string can have nullchars in it Dim Result AS LONG Result = CRC32HASH(STRPTR(MyString), LEN(MyString), ResultCrc) MSGBOX "Result=" & STR$(Result) & ", CRC=" & HEX$(ResultCrc) 'Should return 45862144 END FUNCTION

[This message has been edited by Wayne Diamond (edited August 31, 2001).]
Comment