01-03-2011 04:50 PM
Hi,
I'm having an issue with my custom .NET console when it is deployed on a station and TestStand is not installed.
It seems to crash in the MainForm class when InitializeComponents() function is called.
It crashes on the line in bold:
//
// MainForm
//
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(255)))));
this.ClientSize = new System.Drawing.Size(1014, 732);
this.Controls.Add(this.axApplicationMgr);
this.Controls.Add(this.mainSplitContainer);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(54)))), ((int)(((byte)(60)))), ((int)(((byte)(146)))));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(1440, 900);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "GEMINI - Alstom Montreal";
this.Load += new System.EventHandler(this.MainForm_Load);
this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing);
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.mainSplitContainer.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.axApplicationMgr)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
When I deploy the console, the following TestStand dlls are deployed with the console executable:
Is this an expected behavior or a bug?
Is there a way using the TS API to check if TestStand is currently installed (with or without valid license) on the station?
Thanks for your help.
01-04-2011 04:42 PM
Hi MatLaroche,
Is there an exception that is caused when you execute the line? Cause you could just catch the exception and handle it and continue your code.
Hope this helps!
01-04-2011 07:01 PM
I've add a try-catch in the InitializeComponents() function of the form.
I believe, correct me if I'm wrong, that the error is in the activeX, so not easy to debug since I can't trace in it.
I've attached the error pop-up with stack trace.
The dlls are from TS 4.2.
Thanks.
01-05-2011 11:23 AM
Hi MatLaroche,
The error is indeed an activeX error. The reason is that TestStand is controlled through active X and since the active X class does not exist (since it was never registered with the install), you are getting the error. Now, you can catch that error and handle it by saying something to the effect of TestStand is not installed and then exit gracefully (or however you want to handle it).
Hope this helps!