avinash Report post Posted August 21, 2008 Hi Rahul, I am getting following exception while plotting chart. ex = {"Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown."} This is my code: FC = new AxShockwaveFlashObjects.AxShockwaveFlash(); FC.Movie = Application.StartupPath + "FusionChartsFCF_Bar2D.swf?chartWidth=220&chartHeight=300"; FC.MovieData = chartURL; FC.Play(); plz reply...how to resolve it Thanking you, Avinash Share this post Link to post Share on other sites
Rahul Kumar Report post Posted August 21, 2008 (edited) Hi Avinash, You are getting this message because you are just creating an object of AxShockwaveFlashObjects.AxShockwaveFlash(); and not adding FC into the Form's Control. You need to use this.Controls.Add(FC); like the following code: FC = new AxShockwaveFlashObjects.AxShockwaveFlash(); this.Controls.Add(FC); FC.Movie = Application.StartupPath + "FusionChartsFCF_Bar2D.swf?chartWidth=220&chartHeight=300"; FC.MovieData = chartURL; FC.Play(); Edited August 21, 2008 by Guest Share this post Link to post Share on other sites
avinash Report post Posted August 21, 2008 Thanx Rahul, It works fine........ but it was creating new form control also. I want to show flash movie on same form control .........i dont want to create new form plz reply Avinash Share this post Link to post Share on other sites
Rahul Kumar Report post Posted August 21, 2008 Hi Avinash, If you don't want to add new control then you need not create a new chart Object. You can do the same as following way: FC.Movie = Application.StartupPath + "FusionChartsFCF_Bar2D.swf?chartWidth=" + FC.Width.ToString() + "&chartHeight=" + FC.Height.ToString();//dataXML method FC.SetVariable( "dataXML","<graph><set value='10' /></graph>"); //dataURL method FC.SetVariable("dataURL", "Path to XML file");Otherwise try this: int oldHeight = FC.Height; int oldWidth = FC.Width; int oldTop = FC.Top; int oldLeft = FC.Left; FC.Dispose(); FC = new AxShockwaveFlashObjects.AxShockwaveFlash(); FC.Height = oldHeight; FC.Width = oldWidth; FC.Top = oldTop; FC.Left = oldLeft; this.Controls.Add(FC);FC.Movie = Application.StartupPath + "FusionChartsFCF_Bar2D.swf?chartWidth=220&chartHeight=300";FC.MovieData = chartURL; FC.Play(); Share this post Link to post Share on other sites