FusionCharts Forum: how to resolve InvalidActiveXStateException while loading chart? - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

how to resolve InvalidActiveXStateException while loading chart? how to resolve InvalidActiveXStateException while loading chart?

#1 User is offline   avinash 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 18
  • Joined: 24-July 08

Posted 21 August 2008 - 12:59 AM

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

0

Other Replies To This Topic

#2 User is offline   Rahul Kumar 

  • Supreme Being
  • Group: Moderators
  • Posts: 1032
  • Joined: 18-March 08

Posted 21 August 2008 - 05:39 AM

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();

Regards,
Rahul Kumar
Software Engineer

A byte of magic.

 
0

Other Replies To This Topic

#3 User is offline   avinash 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 18
  • Joined: 24-July 08

Posted 21 August 2008 - 06:19 AM

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

0

Other Replies To This Topic

#4 User is offline   Rahul Kumar 

  • Supreme Being
  • Group: Moderators
  • Posts: 1032
  • Joined: 18-March 08

Posted 21 August 2008 - 07:45 AM

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();

Regards,
Rahul Kumar
Software Engineer

A byte of magic.

 
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic