A
ahmadka
Hi guys...well I am trying to create visio control at runtime instead of at
design time....Specifically I have defiined a struct as follows:
struct visioDisplay
{
public AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
visioControl;
public Visio.Shape[] vNodes;
public Visio.Shape[] vEdges;
public Visio.Page currentPage;
public int visioPageHeight;
public int visioPageWidth;
public int scenarioToBeDrawn;
}
Then I create an array of these structs:
visioDisplay[] visioDisplays;
visioDisplays = new visioDisplay[1];
And finally, I try to access the visioControl in the struct located at first
position in the array:
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(MEPMainGUI));
//visioDisplays[0] = new visioDisplay();
visioDisplays[0].visioControl = new
AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl();
visioDisplays[0].visioControl.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("visicxState")));
visioDisplays[0].visioControl.Window.ShowGuides = 0;
But when the last time executes, I get the
'System.Windows.Forms.AxHost+InvalidActiveXStateException Exception
How can I set this 'state' ? Isnt this the 'ocxstate' that is being set
above ?
Please Help...
design time....Specifically I have defiined a struct as follows:
struct visioDisplay
{
public AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
visioControl;
public Visio.Shape[] vNodes;
public Visio.Shape[] vEdges;
public Visio.Page currentPage;
public int visioPageHeight;
public int visioPageWidth;
public int scenarioToBeDrawn;
}
Then I create an array of these structs:
visioDisplay[] visioDisplays;
visioDisplays = new visioDisplay[1];
And finally, I try to access the visioControl in the struct located at first
position in the array:
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(MEPMainGUI));
//visioDisplays[0] = new visioDisplay();
visioDisplays[0].visioControl = new
AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl();
visioDisplays[0].visioControl.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("visicxState")));
visioDisplays[0].visioControl.Window.ShowGuides = 0;
But when the last time executes, I get the
'System.Windows.Forms.AxHost+InvalidActiveXStateException Exception
How can I set this 'state' ? Isnt this the 'ocxstate' that is being set
above ?
Please Help...