1) make sure that the Procedure in the DLL is StdCall
2) make sure that it is in the DLL's Exporst list
Here is a D4 DLL that exposes :-
N& = Crc32( ByRef S$, ByVal Seed& )
============================================
library CRC32Util;
{uses SysUtils, Classes, Dialogs;}
Developed from VB code published by (TBA?)
Returns same value as DOS PKWARE Crc32
24/6/00 - Checked use of Delphi String - seems OK
as no string manipulation takes place
*)
Var
Crc32Table : Array[0 ..255] of Integer ;
Procedure InitCrc32 ;
Var
Seed : LongWord ;
L9 : LongWord ;
L8 : LongWord ;
CRC : LongWord ;
TempCRC : LongWord ;
Begin
Seed := $EDB88320 ;
For L9 := 0 To 255 Do
Begin
CRC := L9 ; {Initiate CRC to counter variable }
For L8 := 0 To 7 Do {Now iterate through each bit in counter
byte}
Begin
{ Right shift unsigned long 1 bit }
TempCrc := Crc shr 1 ;
{ Now check if last CRC lost a set bit and then
mix Crc32 checksum with Seed Value }
If (Crc And 1) <> 0 Then
Crc := TempCrc Xor Seed
Else
Crc := TempCrc ;
End; {For L8}
{Put Crc checksum value in the holding array }
Crc32Table[ L9 ] := Crc ;
End; {For L9}
End; {InitCrc32}
Function Crc32(Const S:String {!!}; Const Seed:Integer ):Integer
;StdCall;
Var
L9 : Integer ;
ByteVal : Integer ;
CRC : Integer ;
AccValue : Integer ;
Index : Integer ;
Q : Integer ;
Begin
CRC := Seed ;
{ Iterate through the string that is to be checksum-computed }
For L9 := 1 To Length( S ) Do
Begin
{ Get ASCII value for the current character }
ByteVal := Ord( S[L9] ) ;
{ Right shift an Unsigned Long 8 bits (last CRC) }
AccValue := CRC shr 8 ;
{ Now select the right adding value from the holding table }
Index := Crc And $FF ; {Low byte of last CRC}
Index := Index xor ByteVal ;
{ Now select the right adding value from the holding table}
Q := Crc32Table[ Index ] ;
{ Then mix new Crc32 value with previous accumulated Crc32 value
Quote:
}
CRC := AccValue xor Q ;
End; {For L9}
{ Set function value the the new Crc32 checksum }
Result := CRC ;
End; {AddCrc32}
Exports CRC32 ;
begin
InitCrc32 ;
end.
============================================
On Fri, 11 May 2001 21:25:37 -0400, "Dmitrii Boldovsky"
Quote:
> hi to everybody,
>I'm sort of new to the VB6.
>I'm trying to call the DLL wriiten and compiled with the delphi 4.0
>Every time I'm trying to call a procedure from that DLL
>Visual basic returns "Run time Error 453, Can't find enty point ...."
>How can I fight it?
>Thanks ,
> Dmitrii