question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems with ShellNamespaceTreeControl

See original GitHub issue

Hello David,

I just wanted to integrate ShellNamespaceTreeControl but found issues:

1. When using the Designer, I get the following MessageBox:

ShellNamespaceTreeControl - Designer

This happens after dropping the Control onto its form in the Designer, and hitting Start the first time.

2. AccessViolationException:

Describe the bug While playing around with the TreeView, trying to expand this and that Node, I sometimes get an AccessViolationException. This isn’t often the case, about 20-30 tries that went okay before the exception occurs.

Don’t think it has to do with a specific folder type, and when, I couldn’t find the pattern this makes it happen.

Here is the debugger’s “View Details” output:

| Name | Value | Type – | – | – | – ◢ | $exception | {“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”} | System.AccessViolationException   | ▶ Data | {System.Collections.ListDictionaryInternal} | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}   | HResult | 0x80004003 | int   | HelpLink | null | string   | IPForWatsonBuckets | 0x00000000 | System.UIntPtr   | ▶ InnerException | null | System.Exception   | IsTransient | false | bool   | Message | “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” | string   | RemoteStackTrace | null | string   | Source | “System.Windows.Forms” | string   | StackTrace | " at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at Vanara_ShellNamespaceTreeControl.Program.Main() in S:\[Git.Workspace]\[Test-Projekte]\Vanara-ShellNamespaceTreeControl\Program.cs:line 19" | string   | ▶ TargetSite | {IntPtr DispatchMessageW(MSG ByRef)} | System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}   | ▶ WatsonBuckets | {byte[0x000015f0]} | object {byte[]}   | _HResult | 0x80004003 | int   | _accessType | 0x00000000 | int   | _className | null | string   | ▶ _data | {System.Collections.ListDictionaryInternal} | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}   | _dynamicMethods | null | object   | _exceptionMethod | null | System.Reflection.MethodBase   | _exceptionMethodString | null | string   | _helpURL | null | string   | ▶ _innerException | null | System.Exception   | _ip | 0x65ce2f9f | System.IntPtr   | _ipForWatsonBuckets | 0x00000000 | System.UIntPtr   | _message | “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” | string   | _remoteStackIndex | 0x00000000 | int   | _remoteStackTraceString | null | string   | ▶ _safeSerializationManager | {System.Runtime.Serialization.SafeSerializationManager} | System.Runtime.Serialization.SafeSerializationManager   | _source | “System.Windows.Forms” | string   | ▶ _stackTrace | {sbyte[0x000000c0]} | object {sbyte[]}   | _stackTraceString | null | string   | _target | 0x00000024 | System.IntPtr   | ▶ _watsonBuckets | {byte[0x000015f0]} | object {byte[]}   | _xcode | 0xc0000005 | int   | _xptrs | 0x00bad36c | System.IntPtr   | ◢ Static members |   |     | _COMPlusExceptionCode | 0xe0434352 | int   | s_EDILock | {object} | object

What code is involved

Just a plain Windows Forms window, nothing in it except the ShellNamespaceTreeControl. BTW, this also happened to me using the Unit Test App.

Using Vanara v3.2.12, .net Framework 4.6 on a Windows 10 machine.

Thank you very much in advance, regards,

tajbender

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
dahallcommented, Aug 6, 2020

I’ve had to redo much of the ShellNamespaceTreeControl class and am still working through one final bug.

On you second question, there wasn’t a way to get the underlying IShellFolder instance. I just added a property to allow it.

1reaction
dahallcommented, Aug 3, 2020

I can’t figure out how, but I just got your exception. I’m opening this up until I can figure it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Your Implementation of ShellBrowser and ShellView #188
I still have problems getting the ShellBrowser to accept Keyboard input. Although it has focus, ... Forms/Controls/ShellNamespaceTreeControl.cs.
Read more >
Some improvements to ExplorerBrowser, but still not working ...
text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the.
Read more >
Vanara.Windows.Forms 3.4.16
Issues ? First check if it's already fixed by trying the AppVeyor build. If you're still running into problems, file an issue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found