Hello Everyone:
I was hoping there was someone who has some Delphi knowledge that could help with calling a Delphi developed assembly from VB.net. The Delphi assembly is not a com object but only a dll with one exported function. It is supposed to be an AES module in which you pass a password and its encrypted equivilant and the module pases back true if they match or false if not.

I have a database with usernames/ AES encrypted passwords that were built by a Delphi program. I contacted the original programmer for the keys to decrypt these passwords, but he was unable to determine what the keys were so he built me this function.

The problem I am having is either I get false for matches or I get "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

I recieved two versions. The first one took two strings and passed back a boolean:

function checkEqual(clearString, encryptedString: string): boolean;

I found out that he made the strings short strings on the Delphi end which may be a problem on the VB.NET end.

The second assrmbly I recieved was because I could not get the first to work. It took two arrays of char and passed back a boolean.

I am currently tring the one with the arrays of char and have it defined like:

<DllImport("C:\vaebEncCheck.dll", EntryPoint:="checkEqual", SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function checkEqual(ByVal clearString As Char(), ByVal encryptedString As Char()) As Boolean

End Function

I hope someone could help me out with this as I have tried everything I could and am clueless.

Thanks,

Joe