Nathan NZ

Nathan NZ

  • NA
  • 17
  • 0

load C++ dll from C#

Mar 18 2008 8:10 PM

Hello frens,

warm wishes.

I have a decryption library which contains a function

char * decrypt_pass(char * key,char * pass)

{

}

and I am loading it in my C# application as

[DllImport("DllName")]

public static extern string decrypt_pass( string key,string pass);

But If I call the funcation repeatedly, I am getting the AccessViolationException

"Attemped to read or write from protected memory"

Anybody please tell me what is going wrong.

Thanks in advance