how to resolve InvalidActiveXStateException while loading chart?
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



how to resolve InvalidActiveXStateException... Expand / Collapse
Author
Message
Posted 8/21/2008 12:59:21 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 12/22/2008 3:13:14 AM
Posts: 18, Visits: 64
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 + "\\FusionCharts\\FCF_Bar2D.swf?chartWidth=220&chartHeight=300";

FC.MovieData = chartURL;

FC.Play();

plz reply...how to resolve it

Thanking you,

Avinash

Post #8071
Posted 8/21/2008 5:39:33 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 2:34:46 AM
Posts: 192, Visits: 729
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 + "\\FusionCharts\\FCF_Bar2D.swf?chartWidth=220&chartHeight=300"
;
FC.MovieData = chartURL;
FC.Play();


Regards,
Rahul
FusionCharts Team.

Post #8081
Posted 8/21/2008 6:19:31 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 12/22/2008 3:13:14 AM
Posts: 18, Visits: 64
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

Post #8082
Posted 8/21/2008 7:45:55 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 2:34:46 AM
Posts: 192, Visits: 729
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 + "\\FusionCharts\\FCF_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 + "\\FusionCharts\\FCF_Bar2D.swf?chartWidth=220&chartHeight=300"
;
FC.MovieData = chartURL;
FC.Play();


Regards,
Rahul
FusionCharts Team.

Post #8085
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 3:01am


Execution: 0.031.