|

Preface
It is sad that I have to do this, but here we go anyway... this is not an advertisement or endorsement for WinDiff... so don't get your panties all up in a bunch and start harping on what you like or don't like about WinDiff. This project can be easily tweaked to work with any program that takes two paths as command line arguments. I just picked WinDiff because my boss uses it, it is free, and it worked the way I needed it to.
Introduction
WDCMX is a derivative of CMDCMX, which I wrote way back in 1996. Everyone seems to like CMDCMX, so I figured I would share WDCMX too.
As a code example: WDCMX demonstrates an MFC based shell extension implementation. In addition, uses of GetShortFileName(), BrowseForFolder(), and GetOpenFileName() are included. A cool thing to check out is, how I use the BrowseForFolder callback to make the the tree control pre-select a directory.
As a utility: WDCMX allows you to select files (or folders) from within Explorer and pass them to WinDiff.
Using the Utility
Right-click on file and folder items from within Explorer, and select the 'WinDiff' menu item. The first item to compare is indicated by the item you right-clicked on. The second item is indicated by using the browse dialog presented to you after selecting the "WinDiff" menu item.
Using the Code
The current source archive provides a self-contained solution (WinDiffTool.sln) that includes four projects. From these four projects are built context menu handlers and dragdrop menu handlers that target WinDiff and WinMerge. Select either the Release or Debug targets, and build the solution. The deliverables are built into common "debug" and "release" directories off the base directory. You may want to change these outputs to the locations of the respective diff/merge tools for testing.
Look for GetShortFileName, BrowseForFolder, and GetOpenFileName in wdcmx_menu.cpp to see an example of how they are used.
History
- Version 1.01
Posted on July 18, 2006 - MFC is linked static... the MFC redistributables are no longer required.
- Version 1.00 b
Posted on September 28, 2004 - Includes the drag and drop component suggested by Jean-Francois Larvoire.
- Version 1.00
Posted on September 16, 2004.
| You must Sign In to use this message board. |
|
| | Msgs 1 to 25 of 41 (Total in Forum: 41) (Refresh) | FirstPrevNext |
|
|
 |
|
|
The idea to use a BrowseForFolder callback to make the the tree control pre-select a directory does work exactly as advertised. I never had seen that before. THANKS for the great tip!!!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Start > Run > type Windiff does the trick for me.
Maybe if this article showed a different menu item people would see the true benefit.
Good job!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Jeremy L-T wrote: Start > Run > type Windiff does the trick for me.
Sure, but then you have to navigate to both files... this tool allows you to indicate the first file in just two clicks... right click the first file in explorer then select windiff from the popup menu... the first file is now selected and all you have to do now is locate the second file. It saves me considerable time when not working from within an IDE.
Jeremy L-T wrote: Maybe if this article showed a different menu item people would see the true benefit.
Not sure what you mean. Are you saying I should use a different name for the menu item?
Jeremy L-T wrote: Good job!
We'll now I'm totally confused... I thought start>run> type windiff did the trick for you. Regadless, thanks for the kind words!!!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
I am sorry if I am submitting a query at the wrong place. I need to implement dragdrop in my CPropertyPage, for which i have added this->DragAcceptFiles(TRUE); in the sheet. Now it does accept dragged files.
Now I need to read the dropped files for which I am struggling to recieve the event. I have added the OnDropFiles(HDROP hDropInfo) virtual function to both CPropertySheet as well as CPropertyPage but neither of the functions are being called.
Am I on the right track? Where does the function need to be called? Why does it not work in my case? Could someone guide me on how to implement dragdrop for CWnd, if the above method is wrong, else explain me the call mechanism.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
You can also just put your favorite diff too in the sendto directory. Then, you highlight two items and right click send to.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
zPilott wrote: You can also just put your favorite diff too in the sendto directory. Then, you highlight two items and right click send to.
That only works if the files are in the same folder.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hey man thanks for a really nice tool, I use windiff all the time, this really helps me out alot.
thanks again
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Just for the record, I find Windiff does what I need perfectly adequately, and I am also sure that there are other products out there that do it worse or better. What is important is: 1) this project demonstrates shell programming 2) Windiff used to be a pain in the butt to compare directories, and this project makes it a doddle to use
So why is everybody dishing out flak? Thanks for a nice example project that does something instantly useful as well!!
|
| Sign In·View Thread·PermaLink | 4.86/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
The project has been replaced with a solution that includes the WDCMX (WinDiff) and WMCMX (WinMerge) projects along with the new dragdrop projects named WDDDX (WinDiff) and WMDDX (WinMerge). All deliverables are built to a common 'release' or 'debug' directory off the base directory.
The Drag and Drop goes like this:
1)Right click drag a file to a folder and select the "WinDiff" (or "WinMerge") menu item to compare against a file with the same name located in the target folder.
2)Right click drag a folder to another folder and select the "WinDiff" (or "WinMerge") menu item to compare the folder against the target folder.
Thanks to Jean-Francois Larvoire [jf.larvoire@wanadoo.fr] for the great suggestion and the help testing!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Sure... I think that can eaisly be done with a dragdrop handler. Such an implementation would modify the pop-up menu displayed in a right-click-drag operation to include a windiff menu item.
With the context menu handler we could also do a diff on the multi-selection of two files.
Shaun Harrington www.wickedworlds.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Check out Beyond Compare at http://www.scootersoftware.com.
Although not free, it is the best tool we ever used, merging is nothing more than clicking with the mouse. Windiff is just not good enough to merge large projects (> 2000 files) like we have in our company. Beyond Compare saves us lots of work and time and its quite cheap and the support is great. Windiff took us hours to merge, now whe can do the job in 5-15 minutes.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
First of all, I never intended this article to be an advertisement for WinDiff. I don't think it is fair that you try to rip it off to advertise products you want to push.
That said, I think it would have been pretty simple for you to modify my project to use your program... and provide the same functionality for your clients... instead of trying to steal WinDiff's by trying to hijack my article with a single test case.
If your product already provides this functionality then why didn't you mention the fact?
How sad... I guess this is officially an advertising forum now.
|
| Sign In·View Thread·PermaLink | 3.67/5 (2 votes) |
|
|
|
 |
|
|
Yes, beyond compare includes your functionality demonstrated here and no this is not an advertisement. I just use this product in my company for three years of so... We develop totally other software that merger tools...
Yes, it is great that you demonstrate the feature of customizing a popup menu in windows.
And I think it is fair that I promote a product that I am very satisfied off, as a daily user of the product. Many users will read your article (see your title of the article)that are still stuck with windiff and you can hardly call windiff a decent merger tool, from my point of view. The first thing I thaught was : my god is anyone really using windiff these days.
Anyhow I hope you are not so pissed of any more
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
You're right... it is not an ad... it is clearly a BIASED editorial... and a badly written one at that.
Actually, what I was demonstrating was that it is possible to force the selection in the BrowseForFolder dialog.... which a lot of developers don't realize they can do.
You appear to claim that the title of my article may lead some to not look for alternative solutions or some such nonsense? That is just crazy talk. Then you bag on anyone using WinDiff... that was sharp. WinDiff is free... it's solid... and it just happens to be installed on many of the machines I walk up to... and my boss uses it. I wrote this to make his job easier... he loves it... I succeeded at the task. When I read your comment I thought: Holy Cow! Are there really people that call themselves engineers that are ignorant enough to think their way is the only way?
Anyway, good luck on your search for a life. 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I download an eval copy of Beyond Compare and it does have a shortcut menu handler but it does not operate the same way as mine does. I think mine is better... so if BC supports command line args it will be very easy for you to use this project to provide an alternative method of selecting files and folders to compare.
At least check it out and see if you like my method better...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
It does support command line : example BC2.EXE C:\ALPHA C:\BETA or bc2.exe file1.txt file2.txt. In the online-help, there is a section about the command line.
Beyond compare has two ways of handling the shortcut menu. First, you can select one file and then in a completely other folder the other one. Or if both files or directories are on the same level, just select both and choose compare.
And there are multiple plugins, like hex, image, version,... compare that can be choose to from the shortcut menu.
And you are right Shaun, windiff does it job -comparing- quite good. Many people who have visual studio installed, have this installed too. It think it is good for quickly comparing limited stuff, but personally, not for merging large source bases with thousands of files, especially not if I have to do this several times a week.
Then I greatly miss the better and faster way beyond handles directory compares and the split-view compare of files for merging files, without using an external editor. I think winmerge does this too, but at the time I evaluated this package, it wasn't mature enough.
I think it is a mather of taste. And on workstations that don't have my favorite tool installed, your plugin can become very handy in combination with windiff.
I think it would be even more usefull if your plugin could do stuff like selecting two files or directories and just choose windiff.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Anonymous wrote: I think it would be even more usefull if your plugin could do stuff like selecting two files or directories and just choose windiff.
I thought about that... it was just a lot more work and adds a third step to perform the compare. I think having derivations of my extension is a better solution. I'm running wdcmx.dll and wmcmx.dll... now I pick the right tool for the job.
If I owned BC I would make a derivation called bccmx.dll and publish it... would take me about ten minutes... but i don't own BC. Maybe if they donated a copy... 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
WinMerge is a free open source diff and merge tool and sure beats the hell out off WinDiff.
http://winmerge.sourceforge.net
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
First of all, I never intended this article to be an advertisement for WinDiff. I don't think it is fair that you try to rip it off to advertise products you want to push.
That said, I decided to write a quick version for WinMerge... out of the good of my heart. I downloaded the latest "stable" release and found it to be a real piece. I was able to crash it using the command line interface... FIRST TRY! Then I noticed it would not open certain files at all... I tried sending c:\autoexec.bat to WinMerge and it said it could not find the file... so then I started WinMerge through explorer, and selected autoexec.bat using the "browse" button and even though is both showed and allowed be to select c:\autoexec.bat... it would give a message saying the file could not be found.
In closing, I'm sure your project does all kind of cool things... but it sucks at the basics. It sucks at what I need it to do to work with this article's project and that makes it irrelevant to this article.
Thanks for nothing.
|
| Sign In·View Thread·PermaLink | 4.00/5 (1 vote) |
|
|
|
 |
|
|
BTW - I removed WinMerge from my system for now... let me know when you have it cleaned up and we will publish a version of wdcmx for you.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
General News Question Answer Joke Rant Admin
|