When I attempt to run my compiled code, I get the message "Project faulted with message: 'access violation at 0x400089d1: write of access 0x00030dc8'. It happens just after I've established a form, and assigned values to the states of clickable icons on the form Element1.
The violation appears at the v_UGCtank1_click line. I've seen similar constructs work in other programs - am I missing something? Is the problem elsewhere? Thanks...
Code:
__fastcall TElement1::TElement1(TComponent* Owner)
: TForm(Owner)
{
int index = 0;
do {
state[index].v_UGCtank1 = 0;
state[index].v_UGCtank2 = 0;
...
index++;
} while (index < 30);
}
void __fastcall TElement1::v_UGCtank1_click(TObject *Sender)
{ ...