Search code examples
windows-10explorersolidworksuap

Debugging session ends too quickly when explorer used as a startup program - Windows 10 / SOLIDWORKS PDM Professional


I'm trying to debug a class library (PDM Add-in) using Explorer.exe for SOLIDWORKS PDM Professional. I'm on Windows 10. Explorer starts for a second and then something happens that shutdown the debugger.

This what I see in my debug tab.

onecoreuap\shell\windows.storage\sharedstoragesources\util.cpp(6571)\windows.storage.dll!76538288: (caller: 765382E5) ReturnHr(1) tid(c0c) 80004002 No such interface supported
pcshell\shell\appresolver\lib\pintostartcontextmenu.cpp(97)\appresolver.dll!7720C6F5: (caller: 7720DA4B) ReturnHr(1) tid(c0c) 8007007E The specified module could not be found.
onecoreuap\shell\windows.storage\sharedstoragesources\util.cpp(6571)\windows.storage.dll!76538288: (caller: 765382E5) ReturnHr(2) tid(c0c) 80004002 No such interface supported
    CallContext:[\InvokeAssociatedProgram] 

Solution

  • There is some sort of unhandled exception that gets thrown in Explorer by some stupid Microsoft extension. I think it's OneDrive. Since the debugger is attached to Explorer, it crashes because of this fatal error. The debugger doesn't catch the exception because the symbol file of the culprit code is not loaded. Actually, you can see something illuding to that in the output window In Visual Studio.

    This didn't happen to me in Windows 7.

    Solution 1

    Use Notepad.exe to debug Solidworks PDM addins (This is already recommended by Solidworks API doc examples) but I don't really feel comfortable having to go To File > Open > Going to the vault (login) and setting the file filter to solidworks document types every time I start debugging. Moreover, Notepad OpenFileDialog dialog does not support multi-selection.

    Solution 2

    Use this console application I developed that invokes the OpenFileDialog dialog. The console app will:

    1. Log you into the vault.
    2. Uses the vault's path as the start up directory for the OpenFileDialog.
    3. Sets the extension filter for SOLIDWORKS files

    You can enable multiple-selection if you need it.