Posted 15 February 2019, 6:25 pm EST
Hello,
I have just updated to Spread.NET 12. When I try to open a form with a spread I get an error.
Code:
//
// m_grdHingeLocations
//
this->m_grdHingeLocations->AccessibleDescription = L"";
this->m_grdHingeLocations->AllowEditOverflow = true;
this->m_grdHingeLocations->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
| System::Windows::Forms::AnchorStyles::Left));
this->m_grdHingeLocations->ColumnSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
this->m_grdHingeLocations->EditModeReplace = true;
this->m_grdHingeLocations->LFDApplicable = true;
this->m_grdHingeLocations->Location = System::Drawing::Point(72, 96);
this->m_grdHingeLocations->LRFDApplicable = true;
this->m_grdHingeLocations->Name = L"m_grdHingeLocations";
this->m_grdHingeLocations->RowSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
this->m_grdHingeLocations->Sheets->AddRange(gcnew cli::array< FarPoint::Win::Spread::SheetView^ >(1) {this->m_grdHingeLocations_Sheet1});
this->m_grdHingeLocations->Size = System::Drawing::Size(256, 216);
this->m_grdHingeLocations->TabIndex = 1;
this->m_grdHingeLocations->TabStripPolicy = FarPoint::Win::Spread::TabStripPolicy::Always;
tipAppearance1->BackColor = System::Drawing::SystemColors::Info;
tipAppearance1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
tipAppearance1->ForeColor = System::Drawing::SystemColors::InfoText;
this->m_grdHingeLocations->TextTipAppearance = tipAppearance1;
this->m_grdHingeLocations->RowAdded += gcnew Brass::RowAddedEventHandler(this, &FormHinges::m_grdHingeLocations_RowAdded);
//
Error, which happens on these lines:
this->m_grdHingeLocations->ColumnSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
...
this->m_grdHingeLocations->RowSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
“Message: Object reference not set to an instance of an object.” When I comment out those lines, this line
this->m_grdHingeLocations->Sheets->AddRange(gcnew cli::array< FarPoint::Win::Spread::SheetView^ >(1) {this->m_grdHingeLocations_Sheet1});
produces the exception error: “System.AccessViolationException: ‘Attempted to read or write protected memory. This is often an indication that other memory is corrupt.’”
m_grdHingeLocations_Sheet1 has been successfully created above with
this->m_grdHingeLocations_Sheet1 = (gcnew FarPoint::Win::Spread::SheetView());
With these errors already I am very wary about staying on with version 12.