Winform, NullreferenceException PageControl.OnMouseMove
Hi,
I found a way to fix the problem that some experience on a loading of a report. The problem is in the Mouvemouve event of the viewer control. So, to reproduce it, mouve your mouse where the viewer will appeir when the report is loading. You have chance to have the error.
I found that workaround:
- Put the viewer invisible on the load event of the form.
- load the report and do all the stuff you need.
- At the Shown event, put the viewer visible.
Benoit
Also, see KB [#1566763|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533363336333733363333%7D.do]
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]
Similar Messages
-
Crystal Reports Visual Studio 2010 SP2 Fixed issues
Hi All,
Here is the list with fixed issues in Crystal Reports Visual Studio 2010 SP2
http://www.crystaladvice.com/crystalreports/crystal-reports-2010-sp2
The following list with issues is fixed:
1566763 - CRVS2010 WPF Viewer error; "System.NullReferenceException was unhandled" PageControl.OnMouseMove
1540637 - Error: External component has thrown an exception. Launching the Database Expert in the embedded Crystal Reports designer in Visual Studio
1544675 - Error; 'Object reference not set to an instance of an object' when using the CR WPF viewer in VS2010
1578823 - CRVS2010; "Load Report Failed" error when Report is open in any full version of the CR Designer
1638191 - Using RTL language (Arabic) the CR viewer Group Tree Panel does not display RTL
1631283 - Error; 'Failed to load database information' when reporting off of file system data
1553469 - How to enable Database logging in Crystal Reports for Visual Studio 2010
1299185 - Error: Operation not yet implemented or Failed to Export, when exporting a Crystal Reports to Text format
1451960 - Null or empty values are not surrounded with delimiter when exported to CSV format
1659185 - The special Crystal Reports field, 'File Name and Path' shows temp path and temp name when viewing a report
1452648 - Dynamic Cascading Parameter prompts two times when using the Crystal Reports in VS .NET
1580338 - When refreshing a report that contains a linked subreport report takes long time to execute
1659111 - GCHandle left in memory for each open and close of a Crystal Report in VS2010 application
1356672 - Crystal Reports special field "File Path and Name" displays incorrect information in a Visual Studio .NET application
1593658 - Impersonation of database Log On credentials failure in report generation when set at runtime in a .NET application
1661239 - Summary fields are converted to String fields
1661276 - Using the Crystal Reports SetTableLocation method in VS .NET causes long report processing delays
1661200 - Not able to copy text from report objects using the Crystal Reports WinForm viewer for VS .NET
1631722 - Date function in a Selection Formula is removed when running a report in a VS .NET application
1525822 - Exception "Object reference not set to an instance of an object." thrown when clicking on Parameter Panel button in Crystal Report .NET Windows Form Viewer
1603082 - Cross-tab background colors not retained when exporting a report to PDF format
1603154 - Shared variable display the incorrect value in Crystal Reports
1427747 - Why does a CR .NET SDK web app have problems running on IIS 7 in integrated pipeline mode?
1545536 - Alignment set to Justify causes broken underline
Source: Resolved Issues in Service Pack 2 for Crystal Reports for Visual Studio 2010
With kind regards,
Pieter Jong
Crystal Advice
http://www.crystaladvice.comMany thanks for the link Pieter.
I recently created a wiki that lists all of the fixes, their tracking numbers, associated Kbase numbers, Kbase titles and links to the kbases:
http://wiki.sdn.sap.com/wiki/x/tgK3Dw
It's 90% complete. I think I have a few Kbases to do to complete it.
Now that I think about it, I'll also add the link to the [sticky thread|SP 2 for Crystal Reports for Visual Studio 2010 released!; re. SP2 release.
- Ludek -
Error message when displaying a report in a windows form
Hi,
use Cr 2008.SP3 Fixpack 3.5,
Visual Studio 2008 prof. editon version 9.0.30729.1 SP,
:NET Framework 3.5 sp1
vb.net 2008
when displaying a report in a Windows form sometimes the following error message appears
System.NullReferenceException: Object reference not set to an instance of an object
bei CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseMove(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.UserControl.WndProc(Message& m)
bei CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The rest of the error message is in german:
************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.
Zum Beispiel:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.
Thank you
OttoCan you define "sometimes" a bit more?
Is it after a number of runs of a report?
Is it on a particular report?
Is it after you do certain operations on the report (paging, zooming, dill down, print, etc., etc.)?
Can you duplicate the issue if you isolate the report to a new test app?
Did you happen to notice if the issue existed prior to FP 3.5?
Is this on your dev computer or a client computer?
OS?
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports] -
VS 2010 is crashing after installing SAP Crystal report 13.0.
HI Experts.
I have seen many thread related to crashing in VS2010. I feel i am also getting the same error msg.
"Msg:Object reference set to an instance of an object - (Mouse move event)."
I didn't see any proper fix on this issue and I think i can give proper steps to reproduce that, Thats the reason i am posting this as new thread.
Here is my report structure and senario,
I have a sub repot which will display all the parameters and its values which i am setting through my C# application.
i am using crystal report viewer to show my reports. once i click on the subreport i used to get seperate preview tab for my parameters list.. if i click on refresh from this view, on the time of refreshing the application will crash on mouse click in reports. especially on click of that waiting cusor(Which is not there in cr2008). Report will work fine if its load immediatly. problem happening only the reports are taking few time to get load.
In brief, When the report is loading, if we click any where in report,application crashes.
Note:I was using VS2010 and CR2008-Sp3 before. all of my 150 reports are working fine on that time. Last week i have updated CR2008 with SAP Crystal report 13.0. This issue stared after that.
Thanks in advance,
Salah.Hi Don,
Thanks for your reply.
I worked on this to get proper scenario for reproducing this issue. one thing i observed that,
crash is happening regularly the places which i have registered mouse double click event in crystal report viewer. My guess is,While loading the report(On click of refresh), the viewer is empty(bank). That time if we do double click on the viewer its crashing. But confustion is getting error on mouse move event
Hope this will help you guys to reproduce the crash.
We people are really waiting to fix this issue asap. we are also woking in our application to catch the exception somehow. Will update you if i get any progress .
Here is my exception text,
Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thanks,
Salah.
Edited by: salahudheen muhammed on Feb 21, 2011 1:07 PM -
Error in the integrated Crystal Reports viewer from SAP 8.8
Hi, we recently started using the integrated crystal reports from 8.8 and ocasionally the viewer throws the following error:
Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.
************** Texto de la excepción **************
System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
en CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)
en System.Windows.Forms.Control.WmMouseMove(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
en System.Windows.Forms.ContainerControl.WndProc(Message& m)
en System.Windows.Forms.UserControl.WndProc(Message& m)
en CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Ensamblados cargados **************
mscorlib
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4206 (VistaSP2GDR.050727-4200)
Código base: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
B1CRBridge
Versión del ensamblado: 1.0.0.0
Versión Win32: 8.80.235
Código base: file:///C:/Program%20Files%20(x86)/SAP/SAP%20Business%20One/B1CRBridge.DLL
CrystalDecisions.CrystalReports.Engine
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.CrystalReports.Engine/12.0.2000.0__692fbea5521e1304/CrystalDecisions.CrystalReports.Engine.dll
System
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4205 (VistaSP2GDR.050727-4200)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
CrystalDecisions.Shared
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.Shared/12.0.2000.0__692fbea5521e1304/CrystalDecisions.Shared.dll
CrystalDecisions.ReportAppServer.CommLayer
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.CommLayer/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.CommLayer.dll
System.Windows.Forms
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System.Drawing
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Configuration
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
CrystalDecisions.ReportAppServer.ClientDoc
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.ClientDoc/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.ClientDoc.dll
System.Data
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
CrystalDecisions.ReportAppServer.DataSetConversion
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.DataSetConversion/12.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.DataSetConversion.dll
CrystalDecisions.ReportAppServer.DataDefModel
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.DataDefModel/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.DataDefModel.dll
CrystalDecisions.ReportAppServer.Controllers
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.Controllers/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.Controllers.dll
CrystalDecisions.ReportAppServer.CubeDefModel
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.CubeDefModel/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.CubeDefModel.dll
CrystalDecisions.ReportAppServer.ReportDefModel
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.ReportDefModel/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.ReportDefModel.dll
BusinessObjects.Licensing.KeycodeDecoder
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.2.753
Código base: file:///C:/Windows/assembly/GAC/BusinessObjects.Licensing.KeycodeDecoder/12.0.1100.0__692fbea5521e1304/BusinessObjects.Licensing.KeycodeDecoder.dll
System.Web
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4209 (VistaSP2GDR.050727-4200)
Código base: file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
CrystalDecisions.Shared.resources
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.Shared.resources/12.0.2000.0_es_692fbea5521e1304/CrystalDecisions.Shared.resources.dll
CrystalDecisions.CrystalReports.Engine.resources
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.CrystalReports.Engine.resources/12.0.2000.0_es_692fbea5521e1304/CrystalDecisions.CrystalReports.Engine.resources.dll
System.Web.Services
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
CrystalDecisions.ReportSource
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.ReportSource/12.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportSource.dll
CrystalDecisions.Enterprise.Framework
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.2.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.Enterprise.Framework/12.0.1100.0__692fbea5521e1304/CrystalDecisions.Enterprise.Framework.dll
CustomMarshalers
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_32/CustomMarshalers/2.0.0.0__b03f5f7f11d50a3a/CustomMarshalers.dll
CrystalDecisions.ReportAppServer.XmlSerialize
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.ReportAppServer.XmlSerialize/12.0.1100.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.XmlSerialize.dll
mscorlib.resources
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4206 (VistaSP2GDR.050727-4200)
Código base: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
CrystalDecisions.Windows.Forms
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.Windows.Forms/12.0.2000.0__692fbea5521e1304/CrystalDecisions.Windows.Forms.dll
CrystalDecisions.Windows.Forms.resources
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.Windows.Forms.resources/12.0.2000.0_es_692fbea5521e1304/CrystalDecisions.Windows.Forms.resources.dll
CrystalDecisions.Enterprise.InfoStore
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.2.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.Enterprise.InfoStore/12.0.1100.0__692fbea5521e1304/CrystalDecisions.Enterprise.InfoStore.dll
CrystalDecisions.Enterprise.Viewing.ReportSource
Versión del ensamblado: 12.0.1100.0
Versión Win32: 12.3.1102.753
Código base: file:///C:/Windows/assembly/GAC/CrystalDecisions.Enterprise.Viewing.ReportSource/12.0.1100.0__692fbea5521e1304/CrystalDecisions.Enterprise.Viewing.ReportSource.dll
CrystalDecisions.Web
Versión del ensamblado: 12.0.2000.0
Versión Win32: 12.3.2002.753
Código base: file:///C:/Windows/assembly/GAC_MSIL/CrystalDecisions.Web/12.0.2000.0__692fbea5521e1304/CrystalDecisions.Web.dll
FlashControlV71
Versión del ensamblado: 1.0.3187.32366
Versión Win32: 1.0.3187.32366
Código base: file:///C:/Windows/assembly/GAC/FlashControlV71/1.0.3187.32366__692fbea5521e1304/FlashControlV71.dll
System.Windows.Forms.resources
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.4016 (NetFxQFE.050727-4000)
Código base: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada
Por ejemplo:
<configuration>
<system.windows.forms jitDebugging="true"></system.windows.forms>
</configuration>
Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.
Edited by: Vangelis Sanchoyerto on Dec 23, 2010 10:20 AMThe tag doesnt work? :S
-
CRVS2010 Beta / Print Preview crashing
In my app I'm using the CrystalReportviewer component to preview a report. I'm showing the report and also the treeview. I have one report which has about 50 pages. When I page up/own in the report using the keyboard crystal report sometimes crashes with the following error:
System.NullreferenceException: Object reference not set to an instance of an object.
at CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventargs e)
Anyone seen this before? It's not a major problem but still anoying.
ThomasHi
Same message happens to me in production release
To recreate - create a 50 page report and push the page down key continueosly for 1-2 seconds
See full trace:
stem.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>Menahel4U.vshost.exe</AppDomain><Exception><ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Object reference not set to an instance of an object.</Message><StackTrace> at CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message&amp; m)
at System.Windows.Forms.Control.WndProc(Message&amp; m)
at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
at System.Windows.Forms.UserControl.WndProc(Message&amp; m)
at CrystalDecisions.Windows.Forms.PageControl.WndProc(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr 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 M4U_General.cDocumentBase.ShowDialog(cDocumentBase parent) in C:\Projects2010\M4U_General\FormBase\cDocumentBase.vb:line 3596 -
Horrid u201Ccrash for no apparent reasonu201D in the crystal viewer
Hi
We have embedded the new 2010 for VS crystal viewer in our .NET 4 enterprise application.
We are sometimes seeing this crash:
at CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.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(IntPtr 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.Run(Form mainForm)
This seems to happen if the report viewer happens to show where the mouse is and the mouse is moving. This is hard to reproduce but has happen on a number of different machines.
We are running the Crystal viewer on a form in it own message loop with Application.Run(TheForm).
We are running 32bit_13_0_1 crystal runtime.
Any help appreciated.
Regards
Daniel RoweAlso note. Another user had the same issues and the cause was fixed by updating their video card drivers.
They too were on CR SP1.
For all those who find this post please try it first. In the Adapt and Fix in SP2 We have altered the way we render the report objects and added some changes to the order the objects are rendered but it appears the bottom line cause of this is the video card drivers not being able to keep up and throwing an exception which causes CR to crash.
Don -
When I insert a WinForm control in Word Document, I get this exception.
Hi All,
Sometimes, when I insert a general Custom WinForm UserControl in Word Document, I receive this exception. It occurred as accidental. I traced this issue. And debug it. It occurred in this code snippet:
var cs = vstoDoc.Controls.AddControl(CustomControl, range, width, height, controlName);
I checked CustomControl,range,width,height,controlName, vstoDoc, vstoDoc.Controls, all of them are not null object. I am confused.
The Exception:
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.Control.ActiveXImpl.InPlaceActivate(Int32 verb)
at System.Windows.Forms.Control.ActiveXImpl.OnFocus(Boolean focus)
at System.Windows.Forms.Control.OnGotFocus(EventArgs e)
at System.Windows.Forms.Control.WmSetFocus(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WmSetFocus(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WmSetFocus(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at Microsoft.VisualStudio.OfficeTools.Controls.VSTOContainerControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
Microsoft.VisualStudio.Tools.Office.Runtime
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.dll
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
System.Security
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
Microsoft.VisualStudio.Tools.Applications.Hosting
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.dll
Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
System.Deployment
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34244 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
Microsoft.VisualStudio.Tools.Applications.ServerDocument
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Xml.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
Microsoft.Office.Tools
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.dll
Microsoft.Office.Tools.Word.Implementation
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Word.Implementation/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Word.Implementation.dll
Microsoft.Office.Tools.Common.Implementation
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Common.Implementation/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.Implementation.dll
Microsoft.Office.Tools.Common
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
Microsoft.Office.Tools.Word
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Word/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Word.dll
FClassroom.Addin.Presentation
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/FClassroom.Addin.Presentation.DLL
Microsoft.Office.Tools.Common.v4.0.Utilities
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/Microsoft.Office.Tools.Common.v4.0.Utilities.DLL
Microsoft.Office.Interop.Word
Assembly Version: 12.0.0.0
Win32 Version: 12.0.6612.1000
CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.Office.Interop.Word/12.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Word.dll
office
Assembly Version: 12.0.0.0
Win32 Version: 12.0.4518.1014
CodeBase: file:///C:/Windows/assembly/GAC/office/12.0.0.0__71e9bce111e9429c/office.dll
FBD
Assembly Version: 1.13.10.780
Win32 Version: 1.13.10.780
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/FBD.DLL
FAC
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/FAC.DLL
FFK
Assembly Version: 1.15.9.975
Win32 Version: 1.15.9.975
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/FFK.DLL
FRP
Assembly Version: 1.14.3.518
Win32 Version: 1.14.3.518
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/FRP.DLL
System.Data.Entity
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Entity/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Entity.dll
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
PresentationFramework
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
WindowsBase
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
PresentationCore
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
System.Xaml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
FSV
Assembly Version: 1.15.9.236
Win32 Version: 1.15.9.236
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/FSV.DLL
WindowsFormsIntegration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsFormsIntegration/v4.0_4.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
PresentationFramework.Aero
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
PresentationFramework-SystemCore
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemCore/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemCore.dll
PresentationFramework-SystemXml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXml/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXml.dll
UIAutomationTypes
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
log4net
Assembly Version: 1.2.13.0
Win32 Version: 1.2.13.0
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/log4net.DLL
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
PresentationFramework-SystemXmlLinq
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXmlLinq/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXmlLinq.dll
System.Data.SQLite
Assembly Version: 1.0.94.0
Win32 Version: 1.0.94.0
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/System.Data.SQLite.DLL
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
System.Data.OracleClient
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data.OracleClient/v4.0_4.0.0.0__b77a5c561934e089/System.Data.OracleClient.dll
System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34237 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
System.Data.SQLite.Linq
Assembly Version: 1.0.94.0
Win32 Version: 1.0.94.0
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/System.Data.SQLite.Linq.DLL
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
Microsoft.CSharp
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
System.Dynamic
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
PresentationFramework-SystemData
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemData/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemData.dll
Microsoft.VisualStudio.DebuggerVisualizers
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.DebuggerVisualizers/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.DebuggerVisualizers.dll
Newtonsoft.Json
Assembly Version: 6.0.0.0
Win32 Version: 6.0.6.17820
CodeBase: file:///D:/Projects/Development/EduDiagnosis-net/FClassroom.Presentation/bin/Debug/Newtonsoft.Json.DLL
CustomMarshalers
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/CustomMarshalers/v4.0_4.0.0.0__b03f5f7f11d50a3a/CustomMarshalers.dll
Microsoft.Office.Tools.v4.0.Framework
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.v4.0.Framework/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.v4.0.Framework.dll
Microsoft.VisualStudio.Tools.Office.ContainerControl
Assembly Version: 10.0.0.0
Win32 Version: 10.0.50903.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.ContainerControl/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.ContainerControl.dll
System.Dynamic.DynamicAssembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
Thanks,Hi Yang,
Base on my test in Office 2007, it works fine, this is my code below:
internal void AddUserControl()
UserControl1 u = new UserControl1();
var vstoDoc = this.Application.ActiveDocument.GetVstoObject();
vstoDoc.Controls.AddControl(u, this.Application.Selection.Range, 150, 150, "MyUserControl");
Could you reproduce that issue in other machine and new project?
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
NullReferenceException when double clicking on form while report generating
We have an Plugin application that allows a user to generate a Crystal report based on the selected row in a data grid. If the report is large and takes a few moments.to load on a new tab, and the user double clicks on the grid an exception below is thrown (causing the application to close):
System.NullReferenceException: Object reference not set to an instance of an object.
at CrystalDecisions.Windows.Forms.PageControl.TabTo(Int32 sectionIndex, Int32 objectIndex, Boolean scroll)
at CrystalDecisions.Windows.Forms.PageControl.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is there any way (or place) I can trap this error and handle it (meaning swallowing/ ignore it). I have tried using the CrystalReportViewer (crv) Error event and various other crv events but to no avail. I also tried disabling the grid while the report is running but the double-click still causes the exception. Any suggestions are appreciated.
Thanks!
MikeFigured out a work-around for this. What I did in the form that hosts the CrystalReportsViewer was disabled the CrystalReportsViewer after it's report source is set and visible is set to true. I then enable the CrystalReportsViewer right before it's focus is set (which is set in a timer tick event). No more exceptions! Weird but functional!
Mike -
Question regarding ScrollView and pageControl with multiple XIBs
Hi,
I am very new to iPhone programmming and OO type programming in general so please forgive me for my basic questions.
I am trying to set a paging scrollview up with each page being loaded from a different XIB and put into a view controller. This viewcontroller is attached to a scrollview that's put on a "Detail" view. I have this working OK with blank XIB pages.
My question is, when I start adding fields/buttons to the different XIBs how should I then process the actions etc. Do I create a seperate .h and .m file for each XIB and add the individual screen processing into the individual classes or do I use a single class (the "Detail" screen) and do all the processing in that class?, is that even possible?
I do hope that this makes sense. I'm still going through the basic learning books and I'm maybe trying to run before I can walk.
Any help is most appreciated.
ThanksHi Ziximo, and welcome to the Dev Forums!
Ziximo wrote:
I am very new to iPhone programmming and OO type programming in general so please forgive me for my basic questions.
No forgiveness is necessary. You came to the right place.
I am trying to set a paging scrollview up with each page being loaded from a different XIB and put into a view controller. This viewcontroller is attached to a scrollview that's put on a "Detail" view. I have this working OK with blank XIB pages.
In case it's useful to you, here's a thread which shows how to use the PageControl sample app as the template for what you're doing: [Re: Flipping through views help|http://discussions.apple.com/thread.jspa?messageID=10417960�].
My question is, when I start adding fields/buttons to the different XIBs how should I then process the actions etc.
The advice you have from thomas-r is right on target, so I'll just try to add to that. Firstly, I think you may be making a diligent attempt at "top-down" design, which is commendable. However there's a dirty little secret that working programmers don't share with managers: Quite often we don't produce the functional specification until we get the code working.
In other words, thomas-r's reference to Murphy isn't an insult. That's just how software gets designed.
In general, the decision to make a new class should be based on encapsulation and re-usability. For example when you get a memory warning, you might want to release all of the resources required for a screen that isn't currently visible. If that screen and its controller can be fully regenerated from one nib, this can be an easy task.
As another example, say the top-level controller is an instance of your ScrollViewController class. If you limit that controller to managing the scroll view and page control, you'll probably have a class you can reuse the next time you need a paging scroll view. But if you pack the functionality for multiple content views into that same controller, the class will only be useful for an identical app.
.. or do I use a single class (the "Detail" screen) and do all the processing in that class?, is that even possible?
So, no, I would definitely not attempt to put all the control in one class. Yes, it's possible, but besides being bad practice, it's awkward to implement. For example, when you make a nib which is owned by a view controller, it's easy to connect that controller's outlets and action methods to controls which are defined in that nib. There are ways to connect controls to an object defined in another nib, but it's much more difficult. It's not a "natural" configuration, and that by itself should give us second thoughts about our design. On the other hand, if we make one giant nib which is owned by the top-level controller, memory management goes out the window. We would need to unload everything in that nib to gracefully handle a memory warning.
Do I create a seperate .h and .m file for each XIB and add the individual screen processing into the individual classes ...
Yes. This gives us the reusability and encapsulation we want. The only remaining question is: "Do I need a separate controller class with it's own custom xib for each screen?". Well you may not. There could be two or more screens that are so similar (e.g. the same layout and functionality but with a different image) they can each use an instance of the same controller class and share the same xib.
I usually start with a different controller class and a different xib for each screen. Then, near the end of the project, I'll look at all those controllers and see if two or more are nearly identical. If so, I might get rid of one or more classes, and possibly one or more xibs as well. But I'd almost never assume I can merge two controller classes at the outset. If I did that, I might start adding kludges to the merged class as I found differences between the screens I hadn't seen earlier. When the merged class finally got too complex for anyone to maintain, the job of splitting it up might be nasty.
I do hope that this makes sense.
I think that's my line.
I'm still going through the basic learning books and I'm maybe trying to run before I can walk.
If you've suceeded in getting the skeleton working--i.e. you're paging through blank screens, each with it's own vanilla controller/xib, without any bugs, I'd say you're more than ready for the question you're asking here. And it's a very good question.
\- Ray -
Problem with elementHost in a mdi winforms and high dpi
hi,
my problem is simple. when i use elementhost in my mdi winforms applcation, it works very well with 96dpi and 120dpi but if i use 144dpi or more, the display is corrupted. it seems that elementhost force a rescale for each other controls/forms with the dpi
value (fonts, icon, etc rescale and are twice more bigger than before the initialisation of elementhost)
it is not needed to put a wpf control in elementhost to produce the problem and if i remove the lines (for exemple)
this.elementHost1 = new System.Windows.Forms.Integration.ElementHost();
the problem is not present.
can you help me please ? if necessary i can give a test application or screenshot of my problemOne technique that might help to make it all a bit more manageble, is to mark your application as being 'DPI aware'. You will still need to take care to lay out your application properly, but it will not randomly corrupt the entire Form.
A post on stackoverflow.com details two methods, but the second one worked best when I needed this solution. Add the following to you Main method in Program.cs:
[STAThread]
static void Main() {
if (Environment.OSVersion.Version.Major >= 6)
SetProcessDPIAware();
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware(); -
I want to show console output in my cmd prompt in C# winform application
Hi,
I'm launching the some process in C# .net Winform appliaction. But i couldn't able to see console output on the screen. The process is getting launched but inside cmd prompt window, it is showing nothing. I would like to show something on cmd prompt. Please
help on this.
using (Process comxdcProcess = new System.Diagnostics.Process())
comxdcProcess.StartInfo.FileName = fileName;
comxdcProcess.StartInfo.Arguments = args;
comxdcProcess.StartInfo.RedirectStandardError = true;
comxdcProcess.StartInfo.RedirectStandardOutput = true;
comxdcProcess.StartInfo.UseShellExecute = false;
comxdcProcess.Start();
this.errorComment = comxdcProcess.StandardError.ReadToEnd();
StreamReader myStreamReader = comxdcProcess.StandardOutput;
//// Read the standard output of the spawned process.
this.errorComment = myStreamReader.ReadToEnd();
comxdcProcess.WaitForExit();
click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you Happy Programming! Hari@Hariprasadbrk
Do you mean you have use process class to start "cmd prompt" And want to display some output in it?
If so, there is no need to use RedirectStandardOutput property. This property means the output of an application is written to the
Process.StandardOutput stream.
// Setup the process with the ProcessStartInfo class.
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = @"C:\7za.exe"; // Specify exe name not cmd exe.
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
// Start the process.
using (Process process = Process.Start(start))
// Read in all the text from the process with the StreamReader.
using (StreamReader reader = process.StandardOutput)
string result = reader.ReadToEnd();
Console.Write(result);
Output
This section shows the output of the process.
7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19
Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
[<@listfiles...>]
So you can start a cmd exe.
Please also take a look at the article from codeproject
How to redirect Standard Input/Output of an application
In summary, the shutdown proces is invoked from my application, and it displays the output from the process in RichTextBox control.
Have a nice day!
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
WPF report viewer throws exception when print button clicked when hosted on winform
When hosted in a winform app the wpf report viewer control throws an exception when the print button is clicked.
All the other buttons appear to work, any ideas on a work round?
I have created a sample VS 2013 solution that shows this issue
As I can't even attach a renamed zip file it can be downloaded directly from here: http://1drv.ms/QxUrZo
The reason I am attempting to use this control is that the standard reportviewer causes occasional errors in citrix enviroments causing the citrix session to lock up. This appears to be a relatively common issue and the usual issue of both sides (citrix & crystal) blaming the other for the cause and me the developer needs to find a work round.
I've 'bodged' in an additional button on our app to export a loaded report to file as pdf then print it but this should not be the permanent resolution.
BTW glad to see the x64 dynamic parameter issue has been fixed at last, think I reported this over two years ago and again ended up having to work round it.Hi Ludek
A sample project that loads a simple report is available from here: http://1drv.ms/QxUrZo
The project is called WPFReportHost
This loads a simple report when run then you can test the basic functionality of the viewer and all will work until you press the print button and then you get the application crash.
Have to improve my search technique when I googled for other people having this issue I didnt' find the link.
We've noticed the WPF viewer loads considerably faster and has better functionality than the winform viewer and hope that it might solve the citrix preview issue (yet to be tested).
So as a work round we've hidden the default print button added our own and call the report print directly as per below:
using (PrintDialog dialog = new PrintDialog())
dialog.AllowCurrentPage = true;
dialog.AllowSelection = true;
dialog.AllowSomePages = true;
dialog.AllowPrintToFile = true;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
reportDocument.PrintToPrinter(
dialog.PrinterSettings,
new System.Drawing.Printing.PageSettings(dialog.PrinterSettings);
false);
Would be nice to have a fix -
How to use Help View 2 in standalone Winform app similar to VS Package Help2 from DTE2
Hello,
We are successfully obtaining a DTE2 object and then the Help2 object to connect our context id names with triggering the Help Viewer 2 in a VS package but can’t seem to do the same outside of VS.
Here’s a sample of how we handle getting it okay from the VS package code:
dte2 = Package.GetGlobalService(typeof(DTE)) as DTE2;
help2 = (Help2) dte2.GetObject("Help2");
Then we can set out context id like this:
helpId = “MYFORMCONTEXTIDHERE”;
help2.DisplayTopicFromF1Keyword(helpId);
Within VS this works fine for our package. However, the winform app version can’t get the DTE2 object as no instance of VS is running. For instance, an example like this:
dte2 = (DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.11.0");
won’t work as there’s no VS instance.
Given all this…and us not wanting to use the older CHM HelpProvider winforms approach, is there any way we can achieve what the package version is doing in a pure Winforms application?
Thanks,
MichaelHi Michael,
Thank you for posting in the MSDN forum.
Based on your description, I’m afraid that it is not the correct forum for this issue, since this forum is to discuss:
Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
To help you find more useful information or find the correct forum for this issue, would you mind letting us know more information about it?
It is the WinForm developing issue, am I right?
You said that you use the DTE 2 object, is it related to the VS extension?
>> However, the winform app version can’t get the DTE2 object as no instance of VS is running. For instance, an example like this:
dte2 = (DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.11.0");
won’t work as there’s no VS instance.
I did some research about it, the following case and document shared some information about the “Get References to the DTE and DTE2 Objects”, it seems that it also shares some information about “Get an instance of the currently running
Visual Studio IDE” like the code here:
// Get an instance of the currently running Visual Studio IDE.
EnvDTE80.DTE2 dte2;
dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.
GetActiveObject("VisualStudio.DTE.11.0");
Reference:
http://msdn.microsoft.com/en-us/library/vstudio/68shb4dw(v=vs.110).aspx
Another case:
http://stackoverflow.com/questions/21986644/use-addin-project-in-another-application
If still no help, I might not have the correct detailed answer you need, but I might lead you into the right direction to solve your problem.
If it is the WinForm developing issue, you could select the correct forum here:
https://social.msdn.microsoft.com/Forums/windows/en-US/home?forum=winformsdesigner%2Cwinforms%2Cwinformsdatacontrols&filter=alltypes&sort=lastpostdesc
If it is related to the VS extension, maybe this forum would be better for you:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vsx
If I have misunderstood this issue, please feel free to let me know, I will help you find the correct forum for this issue as soon as possible.
Best Regards,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How can I keep my winform application running after logout
Dear developers,
I have an application that insert or update Data to an SQL server every 2, 3 hours.
I can’t use the SQL server itself (creating a new job). Instead I defined a timer which executes the code every 3 hours.
The application runs in the server - a winform application.
And this is the problem, when I logoff the application is being closed…
Is there a way to keep the application running? (same as Jobs)
Tanks,
PatricUri's solution may work for you.
The proper approach though is a SQL Server Agent job. It resides on SS, it gives you nice history.
Talk with the responsible DBA?
Kalman Toth, SQL Server & Business Intelligence Training; SQL SERVER GRAND SLAM
Maybe you are looking for
-
Unable to detect updates, 100% CPU usage by wuauserv
Lawrence, Below is the log you requested. This was taken after renaming the SoftwareDistribution directory. The user reported CPU usage went back up to 100% at around 14:00 after which we killed the service. This is too long for one post, so I'm b
-
Getting task id in boundary event handler
Oracle BPM 11.1.1.6 I have a human task in my process and I want to send out some very customized notification ( very different to the original assignment notification) to the assignee if the task is not actioned within a certain duration. For this I
-
I was thinking of getting an TV but seems like the only feature I will be using is the ability of watching movies and listening to music housed on my laptop wireless on my TV. I have a W series Sony Bravia (direct connect to the web) as well as a PS
-
Query is doing full table scan
Hi All, The below query is doing full table scan. So many threads from application trigger this query and doing full table scan. Can you please tell me how to improve the performance of this query? Env is 11.2.0.3 RAC (4 node). Unique index on VZ_ID,
-
Images still there after cutting (razor tool)
I've used the razor tool to cut out some frames from a single video track. This creates two tracks, which I've pushed together. I then applied the video transition affect cross dissolve. I noticed that only in the dissolve, the cut frames were ble