Solved

Debugging Shell Extensions

Posted on 2006-11-06
5
746 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
[X]
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
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

630 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