ProjectLegacy VBA macro Session.Caption = "" causes Unhandled Exception error

  • 7023035
  • 31-May-2018
  • 03-Jul-2018

Environment

Reflection Desktop (including Pro, for IBM, or for UNIX and OpenVMS) 16.0 or higher
Reflection 2014
Reflection Pro 2014
Reflection for IBM 2014
Reflection for UNIX and OpenVMS 2014
Reflection for IBM 2011
Reflection for UNIX and OpenVMS 2011
Reflection Standard Suite 2011


Situation

If the ProjectLegacy macro method for Session.Caption = "" (set to blank string) in a legacy VBA macro this will cause an Unhandled Exception error of "Object reference not set to an instance of an object" to occur when clicking on "Document Settings".  If the string is not blank and an actual value is set, the problem does not occur.  This problem occurs in both Unix and OpenVMS and IBM sessions.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Attachmate.Reflection.Core.Settings.UI.SettingsForm.CreatePath(XmlNode curNode)
at Attachmate.Reflection.Core.Settings.UI.SettingsForm.AddToMap(XmlElement curElem, Object obj)
at Attachmate.Reflection.Core.Settings.UI.SettingsForm.GenerateBreadcrumbsXml()
at Attachmate.Reflection.Core.Settings.UI.SettingsForm.ShowSettings(Boolean global, DocumentView documentView, SettingsInfo settingsInfo, Boolean reload)
at Attachmate.Reflection.Core.Settings.UI.SettingsForm.ShowDocumentSettings(DocumentView documentView, SettingsInfo settingsInfo, Int32 sectionIndex)
at Attachmate.Reflection.Core.Settings.SettingsManager.LaunchSettingsUI(String settingsInfoId, DocumentView docView, Int32 sectionIndex)
at Attachmate.Reflection.Emulation.Actions.EmulationSettingsAction._Execute()
at Attachmate.Reflection.Emulation.Actions.EmulationSettingsAction.Execute(Object source, EventArgs e)
at Attachmate.Patterns.Action.ExecuteSecure(Object source, EventArgs e)
at Attachmate.UIFramework.Controls.WinForms.DotNetClassicLibrary.DotNetClassicMenuItem._button_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Resolution

Upgrade to Reflection Desktop 16.0 SP1 HF18 or higher. (16.0.506)

In the upgraded version of Reflection Desktop, if the VT or IBM session caption is set to an empty or blank string, then the .Caption method it will be ignored and will use the previous caption value provided. 

A HotFix (HF) for Reflection Desktop is a cumulatively built product update, intended for limited distribution, which addresses specific customer issues and enhancement requests; outside the regular Development release cycle. It is only available to Micro Focus customers with current software support and maintenance contracts, and only after contacting Micro Focus Customer Support directly.  A HotFix undergoes limited stability and quality testing and is intended for quick release to address specific product issues and should not be deployed to production environments without thorough testing.  It is recommended to upgrade to a full-release or a Service Pack version of Reflection Desktop when it becomes available.

Workaround:

Make sure Session.Caption= is not "" (set to blank or empty string) in the legacy VBA macro.