vijay j

vijay j

  • NA
  • 3
  • 0

I am loading a 3rd party dll which returns string value when called from VB.Net but not working in C# .

May 4 2007 5:21 AM

I am loading a 3rd party dll which returns string value.

The string is returned properly in vb.net but when I wrote the same code in c# it is returning an empty string.

My c# declaration and calling code.

[DllImport("desdll.dll"]

      public static extern short TDESDecrypt(string strIn, string key, string strOut)

 

char c= '\0';

string strEncDecResult = new string(c, 1024);

 

 

TDESDecrypt(strIn, key, strEncDecResult);

strEncDecResult = strEncDecResult.Substring(0, ((strEncDecResult.IndexOf('\0') + 1 - 1));

 


Answers (2)