I get an access violation cloning wxGridCellAttr.
Code: Select all
wxGrid* pGrid = new wxGrid(this, ID_GRID_MYCUSTOMID, wxDefaultPosition, wxSize(200,250));
pGrid->CreateGrid(1,12); // I always do this early to avoid problems with missing initialization
wxGridTableBase* pBaseTable = pGrid->GetTable();
wxGridCellAttrProvider* pAttrProv = pBaseTable->GetAttrProvider();
wxGridCellAttr* pAttr1 = pBaseTable->GetAttr(0,0,wxGridCellAttr::Col);
// access violation occurs trying to clone default attributes:
wxGridCellAttr* pAttr3 = pAttr1->Clone();
// another access violation trying to read from provider directly:
wxGridCellAttr* pAttr2 = pAttrProv->GetAttr(0,0,wxGridCellAttr::Col);
My only goal is to successfully call wxGrid's SetColAttr() function with over-ridden defaults. (setting attributes on every cell was too slow)