I am working with a data logging application in EMX. Today, during compilation, it suddenly gives me Error message as “CLR_E_OUT_OF_RANGE”.

While double clicking, it gives message as “The Document Can not be opened. It has been renamed, deleted or moved.”

I have not done anything from given message.

Can any one suggest the solution?

“CLR_E_OUT_OF_RANGE” means exactly what it says - most likely an array index out of range. Tell us about what you changed, and tell us about any more information about when you were building. Also, have you recently done SDK update? When was the last time you had successful build?

Thanx Brett, I have checked with my code. The error is due to some of access static variable usage. I have removed the un-necessary ones and it works fine.

Just for a knowledge update, can u suggest any reference article or document for best practices for not getting “CLR_E_OUT_OF_RANGE” kind of error.

One which i got is that due to some of access usage of static global variables.

As a general rule - be defensive in your programming.

  • Check all “by reference” variables for null.
  • Check arrays if they not empty.
  • Make sure indexes are in range.

Search the topic in internet - there are tons of materials to read.