views:

330

answers:

1

I'm looking for some examples for writing a shell extension in C++ Builder 2010 (2007 and 2009 would also probably be relevant) so I can right click a file in Explorer and get the file path in my VCL program.

I have followed Clayton Todd's tutorial, but it's from 2001, and I have some trouble getting it to work. I can't get it to call my methods (initialize , QueryContextMenu etc.).

+1  A: 

For many years Delphi and C++ Builder have included a sample project (in ActiveX\ShellExt) that adds a "compile" item to project files' context menus. You should start with that. Also read the MSDN discussion on how to create a context menu handler.

Overall, I recommend not using much of the VCL in your shell extension. Keep it small. All it's going to do is implement the basic IContextMenu methods and then send the file names it collects to your main program.

If you've followed the tutorial and read the documentation and some of your methods still aren't being called, then do some debugging to figure out why. Ask yourself: Which functions are being called? Is the DLL getting loaded at all?

Rob Kennedy
ActiveX\ShellExt\contexM probably holds the answer, to bad I do not have that on my computer. =(
Qwark
Then go retrieve it from your installation CD.
Rob Kennedy