Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Debugging Shell Extensions

Posted on 2006-11-06
5
743 Views
Last Modified: 2013-12-03
Platform: VC 2005, on Windows XP.

I am having a lot of trouble debugging my NameSpace Extension (NSE).

When I say ‘debugging’ I do not mean to step through my code and debug it, but rather to understand what is happening inside the shell while loading and using my extension.

More specifically, I can see the folder, when I double-click it, my code is called, and completes successfully, but then nothing happens. I have no way of knowing what is wrong. I would like to receive a message such as “Failed opening folder: missing Interface / error value returned from function X, etc…”

I have heard about debug versions of windows, for driver development, is this useful?

Do you know any other way of understanding the internal state of the shell?

Any help will be greatly appreciated.

Cheers,
Michael
0
Comment
Question by:xmichaelm
  • 2
5 Comments
 
LVL 8

Assisted Solution

by:adg080898
adg080898 earned 400 total points
ID: 17918296
Microsoft docs:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/debugging.asp

Debug versions of windows won't really help, they're mainly for driver development.

Windows explorer is a piece of crap. It barely works, and ignores errors all the time, and has very poor documentation. The answer to everything in MS land is to abort. Something goes wrong in the middle of copying 5000 files, abort. If anything goes wrong, aborts. Don't be surprised if you have trouble integrating with it.

The best way to handle this type of programming problem is to put extensive logging in your app. Log everything, by printing messages to a log file. Then, you can examine your log file and see what is happening without stepping.
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 100 total points
ID: 17919041
There's not much to go on here...

How do you know that your NSE "completes successfully"?
What behavior would you expect ... compared to what actually happens?  Describe both in detail.

As far as I know there is no option in Explorer to output "verbose error messages" or to have it write detailed info to a log.  It's a long shot, but perhaps there might be something in the System Event Log.  Also, I see that you can set the Group Policy settings to audit lots of stuff that is normally not logged (e.g., "Audit object access") and I suppose that that could provide a hint when something internal goes awry in Windows Explorer.
0
 
LVL 8

Accepted Solution

by:
adg080898 earned 400 total points
ID: 17925755
I have a suggestion, use the debugging tools for windows on the windows xp cd. It has a tool called "logger" which records all function calls. It is the best API logger I have seen. Perhaps you could start explorer using logger.exe and record calls to your dll (actually records all calls to any dll from the logged program).

To use logger:

Start/Run/cmd

cd \program files\debugging tools for windows

logger "...full path to program to log..."

It records all function calls to a log.
To view the log, use logview (same place as logger).
0
 
LVL 1

Author Comment

by:xmichaelm
ID: 18376860
What worked for me:

1. A working sample is the best documentation.
2. Download the debugging symbols from microsoft, to see human-readable stack traces.
3. Get a hold of the partial Windows source code, and take a very good look at CDefView.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Standards for file storage. 3 31
Table Size and Indexes in SQL Server 6 26
Problem to packaging 1 98
SSRS troubles 4 68
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question