Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

ArgumentNullException in OpcComputerAndServerDialog.ShowDialog

More
01 Apr 2014 11:27 #1801 by support
I can confirm that this is a bug in QuickOPC 5.23.1052.1 (and most likely, other builds of version 5.23 so far). As you have noted, versions 5.3x are not affected (I have checked this in the code as well).

For version 5.23, the bug will be fixed in build 5.23.1142.1, which I will make now.

Best regards

Please Log in or Create an account to join the conversation.

More
01 Apr 2014 09:46 - 01 Apr 2014 10:00 #1800 by support
From: C.
Sent: Monday, March 31, 2014 8:19 PM
Subject: OPC Computer and Server Browser error

Zbynek,

...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.

His code looks something like this, which is what I would expect:
if (opcComputerAndServerDialog1.ShowDialog() == DialogResult.OK)
            {
                //something
            }

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:


File Attachment:

File Name: clip0010.avi
File Size:40,902 KB




OS is Windows 7 for both of us. Is it a missing icon file that’s giving us the issue?

Here is the full error:
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:

Thanks for the help!

C.
Attachments:
Last edit: 01 Apr 2014 10:00 by support.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.062 seconds