Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception Unhandled 'System.Runtime.InteropServices.COMException' in GetPath(Shell32.ControlPanelItem) #105

Closed
ghost opened this issue Feb 8, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 8, 2020

Describe the bug
The System.Runtime.InteropServices.COMException is thrown when failing trying to get the path using Vanara.Windows.Shell.GetPath(Shell32.ControlPanelItem).

Message:
Error HRESULT E_FAIL has been returned from a call to a COM component.

Stack Trace:

at Vanara.PInvoke.Shell32.IOpenControlPanel.GetPath(String pszName, StringBuilder pszPath, UInt32 cchPath)
at Vanara.Windows.Shell.ControlPanel.SafeCP.GetPath(String pszName)
at Vanara.Windows.Shell.ControlPanel.GetPath(ControlPanelItem item)

What code is involved
Example:

string path = Vanara.Windows.Shell.ControlPanel.GetPath(Shell32.ControlPanelItem.WindowsDefender);

Expected behavior
An empty System.String without the System.Runtime.InteropServices.COMException thrown.

@ghost ghost changed the title Vanara.Windows.Shell.GetPath(Shell32.ControlPanelItem) - Throws Exception Unhandled 'System.Runtime.InteropServices.COMException' Exception Unhandled 'System.Runtime.InteropServices.COMException' in GetPath(Shell32.ControlPanelItem) Feb 8, 2020
dahall added a commit that referenced this issue Feb 8, 2020
@dahall
Copy link
Owner

dahall commented Feb 8, 2020

Fixed in pushed code. Will deploy in next release.

@dahall dahall closed this as completed Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant