.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

Attempted to read or write protected memory. This is often an indication that other memory is corrup

Posted By: venu     Posted Date: January 27, 2012    Points:5   Category :Windows Application
Hi Frieds!

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 ...



Author: Narayanan             
Posted Date: August 07, 2012     Points: 20   

HI venu,
Where to use this DLL in your Project or Check this DLL Code? I think, Please paste your DLL in your debug Folder.

Regards, Lakshmi Naraayanan.S

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend