473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Crash when hooking common dialog boxes in namespace extension

Hello all. Not sure which group this problem best relates to, so I'm
posting to both with a follow up.

I started learning C# and .NET last august for a project for my
employer. The project involved extending explorer by creating a
context-menu extension and allow certain actions to be performed on
certain files. I was able to get that up and running through much
searching on google, but the overall goal of the projects seems like it
would be better served as a namespace extension.

I started researching creating namespace extensions in january and
managed to extened explorer seemingly successfully. I turned then to
making the extension work from within the common dialog boxes so users
could browse it inside other applications when they are opening/saving
their files. Here is where I have hit my problem.

I have browsing of the extension working fine, but I would like to be
able to know when the open or save button is clicked as I may need have
the extension perform some action on the selected file prior to letting
the application open it, or do something after the application saves
the file. To allow for this, I decided to try setting a hook on the
dialog box and watch for the approiate button press message. This
seemed to be working ok until I tried typing in a filename.

The auto-complete list that XP shows when typing a name causes problems
when this hook is in place. It causes the application to crash upon
use and I'm not sure why. The problem only exists if I have the hook
in place on the dialog. If I don't hook the dialog, everything works
just fine it seems. The program throws a NullReferenceException, but I
can't tell where it's being thrown from. When I run the program
through the debugger it tells me:

---------------------------------------------------------------------------
An unhandled exception of type 'System.NullReferenceException' occurred
in Unknown Module.

Additional information: Object reference not set to an instance of an
object.

---------------------------------------------------------------------------

If I try and break, I just get 'No source code available' and nothing
happens. Enabling debugging of unmanaged code doesn't help too much
either. With unmanaged debugging on, I get an error like this:
---------------------------------------------------------------------------
Unhandled exception at 0x01137516 in notepad.exe: 0xC0000096:
Privileged instruction.
---------------------------------------------------------------------------

and breaking drops me into some assembler code.

I narrowed down my application to what I think is the smallest I can
make it. It is still fairly large though. I uploaded it to my site
here: http://www.aoeex.com/testcase.zip If you do download the code
and want to try and run it, I think I have included the necessary
dependencies. The way I have been running it is to copy the dll files
to c:\windows, then running 'regasm Projectmanagerv2.dll' to register
it it. then I launch notepad from the windows directory and use it's
open dialog box to test.
I would much appricate any help in solving this problem that can be
provided. I have other ways to do what I need if necessary, but they
would be less user friendly than if I could get this dialog box
interaction working properly. I also apologize for any horrid code one
may find. As I said above, I've just started learning C#/.NET and
shell extensions for this, and have been learning as I go.
Thanks,
Keith M.

Mar 20 '06 #1
1 1731
Keith,
Hello all. Not sure which group this problem best relates to, so I'm
posting to both with a follow up.

The "best" is for sure not the newsgroup General. My opinion is the other
one.

This is in my opinion by instance not a general problem

Cor


Mar 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DotNetMania | last post by:
How do you specify the startPosition of common dialog boxes in C#? such as OpenFileDialog there is not Position or Location method.... best regards... charles
23
by: George | last post by:
Is there a way to customize the open file common dialog? I am trying to modify the button text so I can create a delete file common dialog. I need the same functionality of the open file common...
2
by: jcrouse | last post by:
In VB .Net is it possible to specify a location (x, y) for message boxes and the common dialog box class like you can do for windows forms? If so, how is this accomplished? Thank you, John
2
by: kmslick | last post by:
Hello all. Not sure which group this problem best relates to, so I'm posting to both with a follow up. I started learning C# and .NET last august for a project for my employer. The project...
6
by: Steve Barnett | last post by:
I need to include a wizard in my application that will, as one of the steps, ask the user to select a file to open and (later) a file to save it as. The naff way to do this would be to have a...
3
by: lookaround | last post by:
Hi everyone, I need some help... I call an external exe (a command-line tool) with Process.Start through this code: try { p = new Process(); p.StartInfo.UseShellExecute = false;...
1
by: ApexData | last post by:
Hello I am in the early stages of my project development, and want to make sure that I am approaching the issue of image display correctly. Access2000. I have one table and a bound single...
2
by: vbaDev | last post by:
Hi. I am using Access 2000 and in my code I'm exporting a table into an Excel file (creating it), then the code needs to export another query into the same file (a new worksheet). So I needed both a...
3
by: TC | last post by:
I have a form which I'd like to display as a sizable dialog box. The behavior I get when I use FormBorderStyle = SizableToolWindow is perfect. However, when I use that option, the title bar of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.