From: C.
...customer ... is getting an error message when trying to use the opcComputerAndServerDialog component. Basically, as soon as he calls showDialog(), an error message pops up.
He is using version 5.23. The full .dll version is 5.23.1052.1 . I was able to replicate this as well. If I point that same code to 5.3 dlls, no error happens. Is there something different going on in the older versions?
The customer has actually provided a video to let us see what happens, and it looks the same when I replicate on my machine:
OS is Windows 7 for both of us. Is it a missing icon file that’s giving us the issue?
Code:
System.ArgumentNullException was unhandled
Message=Precondition failed.: value != null icon
Parameter name: icon
ParamName=icon
Source=OpcLabs.BaseLibForms
StackTrace:
at System.Diagnostics.Contracts.__ContractsRuntime.Requires[TException](Boolean condition, String msg, String conditionTxt)
at OpcLabs.BaseLib.Forms.Browsing.BrowseStateIcon.op_Implicit(Icon icon)
at OpcLabs.BaseLib.Forms.Browsing.RootNodePresentation.GetBrowseStateIcons(Guid iconGuid)
at OpcLabs.BaseLib.Forms.Browsing.CompositeNodePresentation.GetBrowseStateIcons(Guid iconGuid)
at OpcLabs.BaseLib.Forms.Browsing.BrowseTypeDescriptions.AddImagesToImageList(Guid imageGuid, Guid iconGuid)
at OpcLabs.BaseLib.Forms.Browsing.BrowseTypeDescriptions.AddDescription(BrowseTypeDescription desc)
at OpcLabs.BaseLib.Forms.Browsing.BrowseTypeDescriptions.FindTypeDescriptionWithAutoUpdate(Type type)
at OpcLabs.BaseLib.Forms.Browsing.BrowseTypeDescriptions.UpdateTreeNode(TreeNode treeNode, BrowseNodeWithParent newNodeWithParent, BrowseNodesFormViews view, BrowseNodeKinds showKindsInTree, Font defaultFont, Int32 maxErrorMessageCountInTooltip, Collection`1 requestUpdateNodes)
at OpcLabs.BaseLib.Forms.Browsing.BrowseTypeDescriptions.UpdateItems(TreeView treeView, TreeNode parentTreeNode, Collection`1 nodes, BrowseNodesFormViews view, BrowseNodeKinds kinds, Boolean removePreviousItems, Boolean onlyAddNew, Int32 maxErrorMessageCountInTooltip, Collection`1 requestUpdateNodes)
at OpcLabs.BaseLib.Forms.Browsing.BrowseNodesControl.UpdateItems(TreeView treeView, TreeNode parentTreeNode, Collection`1 nodes, BrowseNodesFormViews view, BrowseNodeKinds kinds, Boolean removePreviousItems, Boolean onlyAddNew, Int32 maxErrorMessageCountInToolTip)
at OpcLabs.BaseLib.Forms.Browsing.BrowseNodesControl.UpdateChildren(TreeNode parentTreeNode, BrowseNodeWithParent parentNode, IEnumerable`1 branches, Boolean[] branchHasChildren, IEnumerable`1 leaves, Guid[] updateGuid, Boolean isExpand, Boolean treeNodeChanged, BrowseNodeKinds forceRefreshView, BrowseErrorCollection errorBranchesMessage, BrowseErrorCollection errorLeavesMessage, BrowseNodeKinds kindsToRemove, Guid isActiveGuid)
at OpcLabs.BaseLib.Forms.Browsing.BrowseNodesControl.<>c__DisplayClass16.<BrowseChildrenJob0>b__12()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at OpcLabs.BaseLib.Forms.Extensions.FormExtension.ShowDialog(Form form, IntPtr hwndOwner)
at OpcLabs.EasyOpc.Forms.Browsing.OpcComputerAndServerDialog.RunDialog(IntPtr hwndOwner)
at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
at System.Windows.Forms.CommonDialog.ShowDialog()
at OPCTest.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\lathamr\documents\visual studio 2010\Projects\OPCTest\OPCTest\Form1.vb:line 5
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at OPCTest.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
C.