Solved

Debugging Shell Extensions

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

20 Experts available now in Live!

Get 1:1 Help Now