Tuesday, June 8, 2010

Run-Time Check Failure #2 - Stack around the variable 'hexByte' was corrupted

Please visit my new Web Site WWW.Codedisplay.com

If you are going to develop any game or decoder then you may experience this error. Today when i am developing an ASN decoder for our company i faced the error below:

Run-Time Check Failure #2 - Stack around the variable 'hexByte' was corrupted.

To develop my decoder first i need to develop a turbo C program. Then convert this code into a DLL. When i am calling the dll function from my C# windows application i found this error. The screenshot is given below:

DLL Error

Basically for example this will happen if you are going to write to an invalid address. Mostly this comes from something like this.
char hexByte[5];
hexByte[6] = 'E';

Then when you leave from function scope system will freeing the variable hexbyte then system will prompt this error that the variable is corrupted because you wrote to an invalid address.

So check the variable that is stated in your error message & increase the size of the array will resolve your problem.


Want to say something?

Want To Search More?
Google Search on Internet
Subscribe RSS Subscribe RSS
Article Categories
  • Asp.net
  • Gridview
  • Javascript
  • AJAX
  • Sql server
  • XML
  • CSS
  • Free Web Site Templates
  • Free Desktop Wallpapers
  • TopOfBlogs
    Free ASP.NET articles,C#.NET,VB.NET tutorials and Examples,Ajax,SQL Server,Javascript,Jquery,XML,GridView Articles and code examples -- by Shawpnendu Bikash