Okay, guys, I'm in need of some insight. I am having some trouble with my LoadPanel() throwing the error "LoadPanelAnsi: return value -500. An unspecified error has occured, probably due to corrupted data". It throws this error under very specific circumstances.
I have a number of simple tests that I run to ensure that my application works as intended. The project looks sort of like this:
#include "myprojectfiles.h"
main()
{
TestA();
TestB();
TestC();
...
TestZ();
}
Most of the Test functions go something like this:
TestA()
{
initializeApp(); //Runs project code, including loading and displaying my .uir
interactWithPanel(); //Do stuff
shutDownApp(); //Discards panel
return;
}
The error occurs in TestL(), a bit down, but ONLY if TestB(), TestD(), TestE(), TestG(), TestH() are run before, if ANY of these are not run, the error disappears. Except if I disable TestG(), then the program crashes at the same line, but instead with the error: "General Protection Fault". In all cases, the crash occurs in initializeApp(), which is called from every test in the same manner. The crash occurs even when I have run DisableBreakOnLibraryErrors().
The uir file's timestamp does not indicate that it is changed when I run the program, and I get no matches for "SavePanelState" so I'm pretty sure I do not change the physical file. It is not simply the number of times I have loaded the panel and discarded it either that's the problem (which maybe CVI isn't built for???).
What could possibly cause this? At the moment I do not even know how to bug search this, there's no clear point to look at.
Many thanks for any tips on how to continue the bug searching!