Hi Martin,
It seems VC++ is choking with some of the code.
Have a look at line number,
701: wxAcceleratorEntry entries1[count];
711: wxAcceleratorEntry entries[arr.GetCount()];
I fixed the problem by creating the entries using new and delete them after the for loop like
Code: Select all
wxAcceleratorEntry *entries1= new wxAcceleratorEntry[count];
int count = m_menubar->GetMenu(i)->CopyAccels(entries1);
for (int c = 0; c < count; c++)
{
arr.Add(entries1[c]);
}
delete []entries1;
and
Code: Select all
wxAcceleratorEntry *entries = new wxAcceleratorEntry[arr.GetCount()];
for (unsigned i = 0; i < arr.GetCount(); i++)
{
entries[i] = arr[i];
}
wxAcceleratorTable accel(arr.GetCount(), entries);
GetParentFrame()->SetAcceleratorTable(accel);
delete []entries;
I also found that using wxDevC++ generated code, it will be hard to use the outer level sizer directly to remove and add the child controls. In the enable toolbar function, instead of the Outer Sizer variable, I use
GetSizer() function to manipulate the Sizer. Hope this will be useful to people using VC++.
Thank you so much for providing this wonder component. I'm sure it gives a great face lift to the applications created with wxWidgets.
-Guru Kathiresan[/code]