unknow error after SHOW function was called.
Posted: Tue Oct 20, 2020 1:14 am
i have code running perfectly but the when i call SHOW function on stimulsoft my program is crashing and if just change SHOW function to PRINT the app just give me this error "an error occurred during this operation"
------------------------------------------------------
System.InvalidOperationException
HResult=0x80131509
Message=DragDrop registration did not succeed.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
ThreadStateException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
---------------------------------------------------------------
Code: Select all
var sr_ReportBuilder = new StiReport();
sr_ReportBuilder.Load("Reports\\Report23.mrt");
sr_ReportBuilder.Show();
System.InvalidOperationException
HResult=0x80131509
Message=DragDrop registration did not succeed.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
ThreadStateException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
---------------------------------------------------------------