initializing a display / ReadyState is always = 1

Discussion created by sovain on Jun 13, 2012
Latest reply on Jun 15, 2012 by sovain



Using ActiveView component I faced the same problem with the initializing a display. The purpose of changing the  DisplayURL is to not be hardcoded with the path to .pdi file.


So the  ReadyState is always = 1 and, as a result, TrendDisplay1 = null; this happened once a couple of times. Can anybody help me with that and probably suggest how to avoid using changing DisplayURL.



            axPbd1.DisplayURL =  System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)+ "\\pdi\\trend1.pdi";

private void axPbd1_ReadyStateChange(object sender, AxPBDCtrl._DPbdEvents_ReadyStateChangeEvent e)  {
  if (axPbd1.ReadyState == 4)   {
                TrendDisplay1 = ((AxPBDCtrl.AxPbd)axPbd1).Display as PBObjLib.Display;