After a long time i am posting here.I recently shifted to windows application development team.I had one doubt , i need to use u25idautomation.dll method IDA_C128.But this dll in an un managed dll,so we can't do addreference.We have to call by using Platform Invoke process.I did the same but when the time of calling that method it its giving the following error.Here i am giving my code also.
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
// This is a call to unmanaged code. Executing this method requires
// the UnmanagedCode security permission. Without this permission
// an attempt to call this method will throw a SecurityException:
private static extern string IDA_Code128(string DataToEncode);
iam calling this method in another method ..like
this.LabelContents.Add(new Tuple<string, string, Font, Font>("Barcode", IDA_Code128(txtPalletId.Text), valueFont, valueFont));
this is the line where am calling the method.I done google search but not got any solution can any one please ...