Solved

Debugging Shell Extensions

Posted on 2006-11-06
5
732 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now