I want to use a dll that made by Delphi. It has this function : function CryptStr(str, Key : AnsiString; DecryptStr : boolean) : AnsiString; stdcall;
I copied the Dll in /bin/debug and in application root. my code is :
[DllImport("Crypt2.dll", EntryPoint = "CryptStr", CallingConvention = CallingConvention.StdCall)]
static extern string CryptStr( string str, string Key, bool DecryptStr);
public string g = "";
private void Form1_Load(object sender, EventArgs e)
{
g=CryptStr("999", "999999", true);
MessageBox.Show(g);
}
I have some problem : 1. even I delete Dll from those path application doesn't throw not found exception 2. when application run in g=CryptStr("999", "999999", true); it finishes execution and show the form without running Messagebox line. I tried to use Marshal but above errors remain.