From the CrystalDecisions web site
******************************************
Knowledge Base Article ID: c2006956
Created: 2000/04/18
Reviewed : 2001/07/20
Contact Technical Support
Error: "Object may be corrupt" when adding CR Viewer to a Visual FoxPro form
The information in the article refers to:
Report Designer Component 8
Applies to:
Not tested with other versions
Visual Foxpro
Adding CR Viewer to a Visual FoxPro form
Error: "Object may be corrupt"
Synopsis
A Visual FoxPro uses the Report Designer Component as the reporting development tool.
When you add the Crystal Report View Control to a form, the following error appears:
Error: 'C0000005 - object may be corrupt"
How do you resolve this error message and preview a report through Visual FoxPro?
Solution
To resolve the error message, go to the Form's Load Event and type the following line of code:
SYS(2333 , 1 ) && Enables ActiveX dual interface support
For information on previewing a report in Visual FoxPro using the Report Designer Component, go to
http://support.crystaldecisions.com/kbase and search for kbase C2008253.
******************************************
>WHEN I RUN THE FOLLOWING CODE IN FORM INIT METHOD
>
>THIS.oCrystalReports = CREATEOBJECT('CrystalRuntime.Application')
>THIS.oReport = CREATEOBJECT('CrystalRuntime.Report')
>THIS.oReport = THIS.oCrystalReports.OpenReport('reports\balCodeWidth.rpt')
>THIS.addObject('oleCRViewer','oleControl','crViewer.crViewer')
>THIS.oleCRViewer.Top = 1
>THIS.oleCRViewer.Left = 1
>THIS.oleCRViewer.Height = THISFORM.Height - 2
>THIS.oleCRViewer.Width = THISFORM.Width - 2
>THIS.oleCRViewer.ReportSource = THISFORM.oReport
>THIS.oleCRViewer.ViewReport()
>
>
>System prompt me following error :
>
>OLE exception error: Exception code c0000005. OLE object may be corrup
>
>Why?
>
>TIA.