System::AccessViolationError
Hi!
I have this weird error:
I'm trying to display a report that shows data from a DataTable. The rows in this datatable are inserted from various other datatables. When I click the "print" button the following happens:
- If I move the mouse before the report is displayed everything is OK
- If I don't move the mouse there is about 50% chance that I get a System::AccessViolationError with the following callstack:
This is the function that calls the ShowPrepared() function
Seems kind of weird that a ToolTip throws the exception when the mouse doesn't move ... Any ideas?
EDIT: This ONLY happens with DataTables that are constructed "by hand" - the rows are inserted one by one. The datatables that are filled with queries to the DB work fine.
I have this weird error:
I'm trying to display a report that shows data from a DataTable. The rows in this datatable are inserted from various other datatables. When I click the "print" button the following happens:
- If I move the mouse before the report is displayed everything is OK
- If I don't move the mouse there is about 50% chance that I get a System::AccessViolationError with the following callstack:
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.ToolTip.WndProc(Message& msg)
at System.Windows.Forms.ToolTip.ToolTipNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at FastReport.Report.RSAsY14dr(Boolean , Form , Form )
at FastReport.Report.ShowPrepared(Boolean modal)
at FastReport.Report.ShowPrepared(
This is the function that calls the ShowPrepared() function
private: System::Void PrintReport(String^ report_name, String^ table_name, DataTable^ dt){
try{
Report^ report = gcnew Report();
report->Load(report_name);
// register data source
report->RegisterData(dt, table_name);
report->GetDataSource(table_name)->Enabled = true;
// set the databands datasource so it iterates trough all entries
DataBand^ db1 = (DataBand^)report->FindObject("Data1");
db1->DataSource = report->GetDataSource(table_name);
if(report->Prepare())report->ShowPrepared();
}
catch(Exception^ ex){LOGEX(ex);}
}
Seems kind of weird that a ToolTip throws the exception when the mouse doesn't move ... Any ideas?
EDIT: This ONLY happens with DataTables that are constructed "by hand" - the rows are inserted one by one. The datatables that are filled with queries to the DB work fine.
Comments
Do you have an example that I can run and test?
Where is the ToolTip present on the report control, the toolstrip ?
BTW, the report is indeed created, shown for about a second and then CRASH ...
EDIT: I am talking about the Preview control of course.
I am working on a demo app to replicate the bug but its hard since there is data in the database and so on and so on ... I still believe the error is on my side but I thought the exception could help me ...
I will let you know if i succeed in replicating the error.
Bye