(Translated by https://www.hiragana.jp/)
The Old New Thing : Please feel free to stop using DDE
The Wayback Machine - https://web.archive.org/web/20091211070753/http://blogs.msdn.com:80/oldnewthing/archive/2007/02/26/1763683.aspx
Welcome to MSDN Blogs Sign in | Join | Help

Please feel free to stop using DDE

A commenter asked, "As an application programmer, can I really ignore DDE if I need to interact with explorer/shell?"

The answer is, "Yes, please!"

While it was a reasonable solution back in the cooperatively-multitasked world of 16-bit Windows where it was invented, the transition to 32-bit Windows was not a nice one for DDE. Specifically, the reliance on broadcasts to establish the initial DDE conversation means that unresponsive programs can jam up the entire DDE initiation process. The last shell interface to employ DDE was the communication with Program Manager to create program groups and items inside those groups. This was replaced with Explorer and the Start menu back in Windows 95. DDE has been dead as a shell interface for over ten years.

Of course, for backwards compatibility, the shell still supports DDE for older programs that choose to use it. You can still create icons on the Start menu via DDE and you can still register your documents to launch via DDE if you really want to, but if you take a pass on DDE you won't be missing anything.

On the other hand, even though there is no technological reason for you to use DDE, you still have to be mindful of whether your actions will interfere with other people who choose to: If you stop processing messages, you will clog up DDE initiation, among other things. It's like driving an automatic transmission instead of a manual transmission. There is no requirement (in the United States, at least) that you own a manual transmission or even know how to operate one. But you still have to know to ensure that your actions do not interfere with people who do have manual transmissions, such as watching out for cars waiting for the traffic light to change while pointed uphill.

Published Monday, February 26, 2007 7:00 AM by oldnewthing
Filed under:

Comments

# re: Please feel free to stop using DDE

Monday, February 26, 2007 11:03 AM by required

Does DDE have legitimate uses that rely on the implementation actually being DDE? If not then can't you just hijack the API calls to do whatever it is supposed to do in a more sensible way? (Caveat: I don't recall ever using DDE so I could by posting out of my rear end due to not knowing DDE and its uses intimately.)

# re: Please feel free to stop using DDE

Monday, February 26, 2007 11:06 AM by Peter Ritchie

Ah, let's hope someone from the Acrobat team reads this...

# re: Please feel free to stop using DDE

Monday, February 26, 2007 11:54 AM by Adam

Sorry to pick up on the throwaway comment, but...

As a English driver, where most cars have manual transmission, and as someone who's never driven an automatic in their life - why on earth, as the driver of an automatic car, do you need to watch out "for cars waiting for the traffic light to change while pointed uphill"?

# re: Please feel free to stop using DDE

Monday, February 26, 2007 11:59 AM by Bjorn

Not so much "as the driver of an automatic car," but "as a driver." Americans, at least, tend to roll backwards about 5-10 feet as they switch feet from brake to clutch to gas.

If the manual-transmission vehicle in question is an SUV or minivan, watch out.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:01 PM by bramster

Sorry to pick up on the throwaway comment, but...

As a English driver, where most cars have manual transmission, and as someone who's never driven an automatic in their life - why on earth, as the driver of an automatic car, do you need to watch out "for cars waiting for the traffic light to change while pointed uphill"?

Because the Licence Examiner no longer puts a match box behind the back wheels, to see whether the driver has to co-ordination to take foot off break, put foot on gas, release clutch with other foot and release handbrake, all in the correct split-second timing so that the vehicle doesn't roll backwards into the car behind.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:08 PM by Phill

"Because the Licence Examiner no longer puts a match box behind the back wheels, to see whether the driver has to co-ordination to take foot off break, put foot on gas, release clutch with other foot and release handbrake, all in the correct split-second timing so that the vehicle doesn't roll backwards into the car behind."

Seriously? Is that how you think you drive a manual? You release the clutch until it is at biting point, at which point you move your right foot from brake to accelerator. Or if the  hill is very steep, you use the accelerator to build up revs, again at biting point on the clutch and then release handbrake. You should never roll back at all and you don't need split second timing - you just need a basic understanding of how a clutch works and a feel for the car.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:14 PM by Aaron Margosis

Explorer still uses DDE all over the place.  Most times, when you ShellExecute or double-click something that doesn't end in ".exe", it initiates a DDE broadcast looking for an existing server to handle the request.

[Explorer uses DDE when the registry says to use DDE. Depending on what mix of documents you open, that could be most of them, or not. -Raymond]

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:16 PM by Adam

5-10 FEET!?! Are you kidding?

Yeah, a lot of drivers in England will slip 6" - 1' on a steep hill, but you're never that close anyway. But 5-10 FEET?!? You can't be serious.

(And it doesn't take split-second timing. You can hold the car on the biting point for a few seconds while slowly lowering the handbrake/increasing the gas.)

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:20 PM by Wang-Lo

"There is no requirement (in the United States, at least) that you own a manual transmission..."

I think it's a requirement in Italy.

-Wang-Lo.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:30 PM by Wizou

All right, DDE is bad

But then... what do you suggest as a replacement ??

I don't see any that fits my needs :

- bring the previous instance of the application to the foreground

- quit the current instance of an application

- have the existing instance open a document

These are useful requests during installation ( see http://wiz0u.free.fr/prog/nsisDDE )

Can you post a review of the alternative methods that could be used ?

(Sockets communications seems wrong to me for such needs, plus reserving a specific port for each apps seems also wrong)

# re: Please feel free to stop using DDE

Monday, February 26, 2007 12:45 PM by Bjorn

OLE? FindWindowEx() plus SendMessage()?

# re: Please feel free to stop using DDE

Monday, February 26, 2007 1:41 PM by tzagotta

When a debugger (e.g., Visual Studio) is stopped sitting at a breakpoint, I assume this also stops DDE because of the mechanism you describe.  Specifically, the application being debugged is obviously not responsive, and so this hoses up DDE for the entire machine?

Also, in Vista, wouldn't this be considered a security problem, since a rogue application could easily stop all DDE and effectively execute a DOS attack against other apps that rely on DDE?

Finally, I will state my experience, which is that Outlook is the program that I notice as the biggest offender when it comes to stopping DDE.  This was especially true in Outlook 2003, but I also see it sometimes in Outlook 2007.  Typically if I have an app hosed due to DDE, I'll first check my debuggers, and then close Outlook.

[If a rogue application wanted to execute a DoS, it could do it much more effectively than by mucking with DDE. You're already on the other side of the airtight hatchway. -Raymond]

# re: Please feel free to stop using DDE

Monday, February 26, 2007 2:06 PM by Simon Cooke

Adam -

Yeah, it's kind of weird. In the US, people don't use their handbrakes on hills. I've gotten weird looks in the past because (being British), I do :) But hey, the hills are really steep in Seattle. Rather that than roll back into someone, and it's better than burning the clutch.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 2:31 PM by Dave Wood

Using your handbrake is not only not done in the U.S., it's actively discouraged. I've heard {anecdotally} of people failing their U.S. driving test for using their handbrake at stop lights etc. Besides, many vehicles don't even have a handbrake, only a foot-operated parking brake. Completely bizarre in my opinion, but there you go ...

# re: Please feel free to stop using DDE

Monday, February 26, 2007 2:40 PM by tzagotta

@Dave Wood - Don't all U.S. cars that have manual transmissions also have a handbrake, for the reason that you mentioned?  I thought the other forms of parking brakes were only on cars with automatic transmissions.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 2:46 PM by Tim

The topic of this post made me smile.  

As for broadcasts, I'd always wondered why my only experience of DDE (the dreaded 'Program groups will now be created' message displayed by installers that *really* should have been updated by now) is so damn slow, so it's nice to have some clue.

I only tried to use DDE once, and that was a year or so ago, to see if it was the easiest method of communicating between processes.  It wasn't :-).

DDE is one of those bits of Windows has that warning feeling of "You're returning to 16-bit land!", and that's enough to make me avoid it.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 2:57 PM by jon

Right up until Vista Explorer still used DDE to launch folders (ie, even in XP the default action for Folders was specified via DDE). It's only now that Vista has added the super secret undocumented DelegateExecute stuff that DDE seems to be no longer used for this.

# Vista documentation

Monday, February 26, 2007 3:22 PM by David Heffernan

Does anyone out there have a feel for when the Vista API documentation will be published?

# re: Please feel free to stop using DDE

Monday, February 26, 2007 3:52 PM by sebmol

"Don't all U.S. cars that have manual transmissions also have a handbrake, for the reason that you mentioned?  I thought the other forms of parking brakes were only on cars with automatic transmissions."

No, they don't. I used to drive a 1995 GMC Sierra pickup truck with manual transmission. The break was to the left of the clutch and had to be operated with the foot. Seeing that I only have two of those, you couldn't use that brake to start from a steep hill.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 3:53 PM by sebmol

And that should have been brake, not break...

# re: Please feel free to stop using DDE

Monday, February 26, 2007 4:50 PM by Chris Hanson

I &^&%^%@ hate the Windows "We send you everything and you're required to listen and acknowledge them all whether you were interested or not" event model. If I don't want WM_TIMER, why should I be force-fed it a dozen times a second and be forced to repeat "no thank you, no thank you, no thank you". It makes debugging window events a real pain, since if you breakpoint something upstream of the WM_message switch, you immediately start hitting it.

I know there are several ex-Amiga programmers who read this -- I much preferred the IDCMP event model it and probably countless other windowing systems) used, where one has to specifically request event types before they are sent. It also means the apps spend a LOT less time wasting CPU cycles handling messages they didn't care about anyway.

Perhaps you could write an article about the motivations behind THAT decision. I know it doesn't fit the "subclass" design paradigm as well, but it sure seems like it would have _worked_ better.

[Dude, message-passing is the wave of the future! -Raymond]

# re: Please feel free to stop using DDE

Monday, February 26, 2007 4:55 PM by Sven Groot

David Hefferman: it's been available since Vista went RTM in November: http://www.microsoft.com/downloads/details.aspx?familyid=C2B1E300-F358-4523-B479-F53D234CDCCF&displaylang=en

# re: Please feel free to stop using DDE

Monday, February 26, 2007 5:25 PM by Jess Sightler

I've never seen a US'ian fall backwards 5-10 feet while starting off in a manual.

Unfortunately, US cars have occasionally liked having pedals for parking brakes, and therefore have not had a handbrake.  I believe that all currently built manuals have handbrakes, but that could also be mistaken.

US teaching on driving a manual is often designed to instill the idea that using the handbrake is a bad thing.  Yes, US teaching it this way is stupid.  Oh well.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 5:29 PM by jeff

On my home machine, Windows Explorer seems to lock up semi-regularly for some number of seconds, and I'm guessing that the problem is that one of the processes on my machine is not responding to the DDE broadcast.  Is there any tool or solution for either eliminating this problem, or else for locating the offending program or service?

# re: Please feel free to stop using DDE

Monday, February 26, 2007 5:40 PM by James

"[Dude, message-passing is the wave of the future! -Raymond]"

Some masking would be nice, though; RISC OS had that many years ago, with a lot more control than the min/max values you can pass to GetMessage. (You'd pass a bitmask identifying the message types you're interested in, then you could pass a list of the user message numbers you'll understand.) Message filters might be able to achieve a similar effect, but probably without the efficiency/performance gains...

[Good-bye modal loops. -Raymond]

# re: Please feel free to stop using DDE

Monday, February 26, 2007 6:46 PM by Brian E

"Yeah, a lot of drivers in England will slip 6" - 1' on a steep hill, but you're never that close anyway."

Ah, spoken like someone who doesn't drive in the US. I regularly see traffic at stoplights separated by 1' or less. That's why there's so many crunched rear bumpers here - every fender bender turns into a chain reaction.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 6:53 PM by Legolas

Right, and to say that I was going to implement some DDE code tomorrow. I don't really expect you to know this of hand, but if you could point me in the right direction, places to search etc, I might be saved ;-)

My reason for doing this is with IE7: I'd like to start a browser with a file url with params (file:///C:/...htm?a=b&c=d). IE6 and firefox: no problem just Createprocess with "app.exe file:///C:/...htm?a=b&c=d". But IE7 cuts of the params. Not sure why (some form of attack protection/mitigation?).

So looking at the registry, it also has DDE keys so this was where I was going to go next. Any better ideas/avenues I might explore? Knowing nothing about this (I just want to show my apps help), I never thought DDE wasn't recommended anymore. What then, OLE Automation? Not sure how that works though.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:08 PM by Mark Sowul

jeff - http://blogs.msdn.com/oldnewthing/archive/2006/02/10/529525.aspx#529675

I've found this to be tremendously helpful.  It helped me find out that Adobe's PDF IFilter was causing the Indexing Service to do this to me.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:26 PM by Tim

"If I don't want WM_TIMER, why should I be force-fed it a dozen times a second and be forced to repeat "no thank you, no thank you, no thank you"."

So, like Windows does it then?  You won't get WM_TIMER messages unless you ask for them, will you?  I mean, if you haven't asked for them, how often would they arrive?!  How does Windows know when to send them?  Does it use Raymond's psychic debugging techniques?

WM_TIMER is a virtual message anyway, iirc - it never goes in the queue, Windows just injects it at the appropriate point as required, doesn't it?  (Or that's how it was explained to me by a Windows dev at an MS DirectX conference once.)

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:30 PM by Miral

XP actually seems to *want* to make you use DDE -- if you go into the File Types->Advanced section and look at almost any verb, you'll see the Use DDE checkbox is ticked.  And if you uncheck it, click OK, and go back in, it'll be checked again.

Other than that, I agree with Wizou.  Ok, DDE may be "bad", but there really isn't a shell-supported replacement technology to avoid starting up multiple instances of a program.  So it's up to the application developer to roll their own means of finding an existing instance of their application and passing command line arguments over to it, which in turn means that some people have just given up (leading to bad UI experiences) and others have implemented all sorts of weird designs, some of which may be buggy or have unintended consequences.

It's even worse over in the .NET world, since you can't get at DDE, nor can you use the most common trick (FindWindowByClassName) since you have no idea what your window class name is.  Finally in .NET 2.0 something was added in the VB namespace that will handle this sort of thing fairly automatically (which can be used from other languages, albeit somewhat clumsily), but some people have reported that even this doesn't scale well to opening lots of files simultaneously from the shell.

So, where's the replacement for DDE?

[If you want to use DDE, then go ahead and use DDE. My point is that nobody's forcing you either. -Raymond]

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:32 PM by MadQ

<sarcasm>

"To demonstrate our superior intellect, we will now regale you with off-topic untruths you have no way of disputing."

In Germany at least, cars with manual-transmission tend to roll backwards a bit when starting up-hill. The matchbox test is a myth. I know this because I worked hard to afford the thousands of Marks for my pink "rag," as a driver's license is collquially known. Oh, and it's pink. Just like my greencard. Go figure.

</sarcasm>

Raymond, I am so sorry. The temptation was too great. But, while I'm here, can you sign my copy of your book?

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:36 PM by Tim

@Legolas

The Win32 function ShellExecute() may be your friend.  Call it with the 'open' verb and pass it your properly formed URI (with params) as the lpFile parameter.  I do this in one of my own programs to let the user check a page on my website to see if there is an upgrade available - I pass the current version as a CGI var, so I guess it should work with file:// URIs too (although I haven't actually tried it).

Caveat: This will of course open the default web browser, which may or may not be IE - I can't tell from your question if you're specifically calling particular browsers, or just want to open the user's browser of choice.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:37 PM by Norman Diamond

After reading the blog posting here, and also

http://blogs.msdn.com/oldnewthing/archive/2004/11/26/270710.aspx

I was wondering how it's possible to use ShellExecuteEx and stop using DDE at the same time.  But then:

> Explorer uses DDE when the registry says to

> use DDE.

What are the other methods?

I've just taken a glance at the documentation of ShellExecuteEx and a few neighbouring sections of the helpfile that comes with the Vista SDK.  I'm not sure yet what else to try searching for.

Off-topic:  In the table of contents in the helpfile that comes with the Vista SDK, at first it looks like ShellExecuteEx isn't documented.  The table of contents jumps from SHDoDragDrop to Shell_GetCachedsomething, bypassing ShellE-anything.  I thought I read somewhere that Microsoft had developed some corporate standards on sorting?

[The whole point of ShellExecuteEx is to execute the document according to its registration. If the registration says "use DDE" then it will use DDE. If you don't like that, then don't use ShellExecuteEx. I also like how you interpret even the simplest behavior change as the sign of some sort of vast conspiracy. -Raymond]

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:44 PM by Ian Argent

On the topic of manual transmission - I too owned a manual transmission vehicle with a foot-controlled parking brake (actually, 2, only one of which was a US brand, and that was a rebadged Mazda). I learnt to drive partially on a vehicle with a handbrake, and very quickly realized that if you are on a hill, about to make a turn, and the light goes from red to green, you have to co-ordinate all 4 limbs, and your arms are doing 2 entirely disconnected things (the legs are balancing the clutch and gas, at least). My answer to that was to always own a vehicle with a certain amount of torque. I've never actually used a parking brake in traffic in any vehicle I've owned, at least as a general rule. (Come to think, my current automatic-transmission vehicle doesn't have a handbrake).

# re: Please feel free to stop using DDE

Monday, February 26, 2007 7:45 PM by Yuhong Bao

"DDE is one of those bits of Windows has that warning feeling of "You're returning to 16-bit land!", and that's enough to make me avoid it."

Except that the demise of DDE only came after Windows NT 3.1, the first implementation of Win32, was released.

Folks, when you are talking about the history of Windows, remember that Windows NT 3.1 ported a lot of the user interface, API, and applets from Windows 3.1, complete with message broadcasts, DDE, OLE 1.0 (32-bit OLE 2.0 did not come until the Windows NT 3.5 timeframe, I think), IsBadReadPtr and IsBadWritePtr, and a lot of other technologies and APIs that are not optimal for a prementive multitasking environment. Susquent NT 3.x releases use less and less of Windows 3.1, esp. Windows NT 3.51, but the transition to the Windows 95 UI was not complete until NT 4.0.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 8:21 PM by steveg

Ah, Win16 + DDE. Fond memories. Back when a UAE was a real UAE, software came on floppies, and Microsoft C++ For Windows was hopelessly outclassed by Borland C++.

And floppies. The joy of re-installing a corrupt Windows 3.1x installation several times a week.

Has anybody tried Windows 3.1x on a modern machine? It must boot in about a nanosecond.

Raymond is OLE1.0 next?

# re: Please feel free to stop using DDE

Monday, February 26, 2007 9:27 PM by Dean Harding

I never really thought about the foot-handbrake thing in American cars (I guess because I had an auto when I was there - I still thought it was a bit weird, though). But now that it is pointed out, I can't believe how you could sell a manual without a HAND-brake!

The thing is, once you know how to use the hand brake correctly, there's really no reason why you should roll back at ALL, even on a really steep hill - it just becomes second nature (like all aspects of driving, really)

I thought Raymond's initial point about taking manual drivers into account was simply that they might take a bit longer to get started (especially if they've taken it out of gear while waiting). I never even thought rolling back would be an issue.

# re: Please feel free to stop using DDE

Monday, February 26, 2007 9:37 PM by Dean Harding

> I thought I read somewhere that Microsoft had developed some corporate

> standards on sorting?

What were you expecting? Everywhere I've seen, "_" sorts before letters...

# re: Please feel free to stop using DDE

Monday, February 26, 2007 10:44 PM by Jeremy Morton

Many times a day, I kill AcroRd32.exe because it blocks DDE messages and *doesn't quit when you stop looking at a PDF in IE, nor even when you close IE*. This has been a problem for at least 3 major versions now. Sorry, just had to vent...

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 12:53 AM by Miral

I tend to mark .pdf files as "download only" so that the plugin doesn't get a chance to run and annoy me.  Especially handy when I didn't realise that I was clicking on a .pdf in the first place.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 1:03 AM by Mark Sowul

Miral -

Try using .NET remoting.  There's a nice bit of work you can do in the Program.cs to grab a mutex and listen on an IPC channel; if you can't grab the mutex (because of the other instance) you can use the IPC channel to send commands to the other instance.

Jeremy -

Agreed!  Adobe Reader is often a colossal pain.  And I eagerly upgraded to 8 hoping it would be fixed, but never got to checking because I reverted immediately when I saw they crippled the UI.  I've heard good things about Foxit reader or something.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 2:54 AM by Marc K

"[The Vista documentation] has been available since Vista went RTM in November."

The documentation seems to be lacking at the moment.  For example, the documentation for GetTokenInformation is missing information about TokenIntegrityLevel, TOKEN_MANDATORY_LABEL and the rest of the Vista token stuff, the SystemParametersInfo documentation has several items marked as "TBD" and that documentation you mentioned promises that LoadIconWithScaleDown will become available when Vista RC1 is released.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 3:49 AM by directx

+1 for DDE :-)

Despite of its drawbacks DDE remains for me, by far the easiest way of implementing most of the time trouble free, inter-process communication and I am really glad that Windows still provides support for it.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 4:44 AM by Thomas Freudenberg

"Try using .NET remoting.  There's a nice bit of work you can do in the Program.cs to grab a mutex and listen on an IPC channel; if you can't grab the mutex (because of the other instance) you can use the IPC channel to send commands to the other instance."

That won't work if your application is a client app required to be runnable on a Terminal Server. In this case you can't use Remoting, at least not TCP/IP.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 5:12 AM by //@

+10 for DDE and most people would be surprised what it can do, another one in a grave of .NET, Vista, no GDI acceleration and other pretty 'oh I'm modern all the way to making my machine and x-RAM cry'.

Beside that Toolbar right/hold click + left click bug, do you guys mind fixing bugs or filtering (when appropriate) some messages sent to the explorer.exe as it does like to eat a hell of a lot messages as well as page faults.

M _

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 5:22 AM by Legolas

@Tim, that was exactly what I was doing, and that is what is not working anymore for IE7, it cute of the params... On to the workarounds!

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 11:21 AM by mschaef

"But now that it is pointed out, I can't believe how you could sell a manual without a HAND-brake!"

Even if you have a foot operated e-brake, you might be able to heal-and-toe your way to a nice, roll-back-less start.

Personally, when I drove manual tranmission cars, the key to starting on a hill was just to be quick about getting moving. If you're in first with the clutch disengaged, it doesn't take that much time to get enough engine speed and clutch engagement to avoid both a stall and a significant roll back. Then again, in Seattle or San Fran, where the hills are steeper than in Austin, it might not have worked so well.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 2:14 PM by Tim

@Yuhong Bao

Er, isn't that pretty much what I implied?

NT 3.1 did have lots of stuff from Win16 (I know, I was there, too, even did some Win32s work for my sins), but it had to, otherwise a load of apps wouldn't have worked.  And Raymond knows a song about that.

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 3:13 PM by David Heffernan

Anyone who thinks that the official Vista documentation actually documents Vista is seriously misguided.  

As I commented in an earlier post, for example, the only known documentation of the manifest route to Vista DPI awareness is in Raymond's book (page 467)!

I asked what Raymond's source for this nugget was and his response was: "I think somebody mentioned it to me, I forget exactly." which is clearly nonsense - nobody remembers "<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<asmv3:windowsSettings

xmlns="'>http://schemas.microsoft.com/SMI/2005/WindowsSettings">

<dpiAware>true</dpiAware>

</asmv3:windowsSettings>

</asmv3:application>" if it was "mentioned to you".

Clearly this was cut and paste from internal MS documentation.  Anti-trust settlement anyone?

I know Raymond isn't responsible for this, but this is what happens when a corporation starts blogging.  You get feedback from your customers which you can then listen to and improve yourselves.

;-)

[What was mentioned to me was "You can do this in a manifest." The rest was legwork that you could've done too. (Hint: Use Visual Studio to look at the manifests of various Vista binaries.) If there's any internal Microsoft documentation on this, I sure didn't see it. -Raymond
P.S. Are you suggesting that I should stop telling stories that involve information not otherwise publically available?
]

# re: Please feel free to stop using DDE

Tuesday, February 27, 2007 10:46 PM by Norman Diamond

> The whole point of ShellExecuteEx is to

> execute the document according to its

> registration. If the registration says "use

> DDE" then it will use DDE. If you don't like

> that, then don't use ShellExecuteEx.

OK.  I don't know how to interpret what part of the registry to figure out if the registration says "use DDE" or not.  I see things that resemble command lines for verbs like "open" or "print", but I thought they always used DDE.  Actually

http://blogs.msdn.com/oldnewthing/archive/2004/11/26/270710.aspx

also gives the impression that DDE is a standard part of ShellExecuteEx's operation.  If I was planning to code a call to ShellExecuteEx, but now want to code a workaround when the filetype's registration tells ShellExecuteEx to use DDE, what should the code look for in the filetype's registration?

> I also like how you interpret even the

> simplest behavior change as the sign of some

> sort of vast conspiracy.

I like how you interpret something, that I still can't see in my comment, as an interpretation of vast conspiracy, which I also don't see in my comment.  Where did this come from?

Monday, February 26, 2007 8:21 PM by steveg

> Has anybody tried Windows 3.1x on a modern

> machine?

Can you get a modern hard disk small enough so that the FORMAT command won't divide by zero?  In year Y2K I found a workaround for a friend's machine, but have forgotten it by now.

[There is no "ShellExecuteEx without DDE"; DDE is part of the rules by which ShellExecuteEx operates. It's like asking for a CreateWindow that doesn't send a WM_CREATE message. If you don't want DDE then don't use ShellExecuteEx. (I read "I thought I read somewhere that Microsoft had developed some corporate standards on sorting?" as implying that you were offended by some evil Microsoft plan to change the rules of sorting. Perhaps you were instead merely expressing in your own way your pleasure with the collation rules?) -Raymond[

# re: Please feel free to stop using DDE

Wednesday, February 28, 2007 4:19 AM by Norman Diamond

> There is no "ShellExecuteEx without DDE";

> [...] It's like asking for a CreateWindow that

> doesn't send a WM_CREATE message.

Then in order to feel free to stop using DDE, we have to feel free to stop using ShellExecuteEx, 100%?  Or, umm...

>>> If the registration says "use DDE" then it

>>> will use DDE.

If the registration doesn't say to use DDE, then will ShellExecuteEx perform without DDE?  And if so, then is there a way for an intending invoker to inspect the registry and figure out if ShellExecuteEx will use a safer method?

> Perhaps you were instead merely expressing in

> your own way your pleasure with the collation

> rules?)

I merely expressed approximately two observations, one of which I'm sure of (the effect of the helpfile's collation) and one which is a vague recollection (that Microsoft had set a corporate standard for collation).  I neglected to state that the two seem to be incompatible with each other.

[I can never tell whether you are genuinely confused or you are just nitpicking for nitpicking's sake. By "You are free to stop using DDE" I mean "You are free to stop writing code that participates in DDE conversations." As I note in the final paragraph, you still have to be aware of others that continue to use DDE. I don't see why you find it so surprising that there are multiple conflicting collation algorithms. Isn't that the whole point of Michael Kaplan's blog? (I mean, look at all those flags to the CompareString function, and that's just within one language!) -Raymond]

# re: Please feel free to stop using DDE

Wednesday, February 28, 2007 8:21 AM by BryanK

Regarding DDE in a file's registration:

On 2K and XP at least, ShellExecuteEx first looks up the file's extension under HKCR.  The default value in that key is the name of another key under HKCR, and that key will have a shell\<verb>\ddeexec subkey if <verb> on the file should use DDE.  This ddeexec key will have a few values and subkeys of its own which affect the DDE conversation, but I'm not quite sure how most of that works.

I do not believe ShellExecuteEx will use DDE if you give it an executable, only a "document".  But I'm not sure on that.

And I bet that many of these details are subject to change in the future.

# re: Please feel free to stop using DDE

Wednesday, February 28, 2007 8:32 AM by Chris Oldwood

In the financial world DDE is still alive and kicking for IPC. If you need data from Bloomberg, Reuters, Telerate etc. then Excel + DDE is often a winning combination.

# Vista documentation

Wednesday, February 28, 2007 2:22 PM by David Heffernan

Raymond,

Many thanks for taking the time to respond to my posts - this is very much appreciated.

I'm surprised that you are as much in the dark as the rest of us.  That you have to reverse engineer the Vista binaries yourself is mildly amusing.  I don't think I would be very happy to release software based on information gathered in this way.  I'll wait until I can read the official manifest documentation before I rely on that.

As for "telling stories that involve information not otherwise publically available" please do continue.  It's not the telling of the stories that bothers me, it's the fact that the documentation has not been published.  I can now see that you share our pain and have to dig it out yourself just like us plebs!!

Cheers, David.

# re: Please feel free to stop using DDE

Wednesday, February 28, 2007 9:25 PM by Norman Diamond

> By "You are free to stop using DDE" I mean

> "You are free to stop writing code that

> participates in DDE conversations."

I guess you mean that we should avoid writing code that acts like a server side of DDE conversations.  OK, I'm not sure if I've done that or not (I'm not sure if any Visual Studio wizards that I've used might have done that).  The word "using" made me think of the client side of DDE conversations, i.e. callers of ShellExecuteEx.

> I don't see why you find it so surprising

> that there are multiple conflicting collation

> algorithms.

Of course there are, because different customers have different needs, some of which are met by some vendors and some of which have to be developed specially.  But I thought I'd read somewhere that Microsoft had set a corporate standard for the order in which its own products would display information.

Wednesday, February 28, 2007 8:21 AM by BryanK

Regarding DDE in a file's registration:

>  that key will have a shell\<verb>\ddeexec

> subkey if <verb> on the file should use DDE.

Thank you.  So if a client should be sure to avoid DDE then the client can look for that key and decide to call CreateProcess instead of ShellExecuteEx.  (I wonder if the resulting process will try to detect multiple instances of itself and hang itself, but at least it will only hang itself and not the caller.)

Wednesday, February 28, 2007 2:22 PM by David Heffernan

> It's not the telling of the stories that

> bothers me, it's the fact that the

> documentation has not been published.

I second that.

[By "You are free to stop using DDE" I mean "You are free to stop writing code that participates in DDE conversations." This covers both server and client side. I think you once again are willfully ignoring my last paragraph. Just because you are free to stop doing something doesn't mean that you have the right to stop other people from doing it. You are free to stop eating meat, but that doesn't mean you can force other people to go vegetarian. (It appears that the manifest information has now been added to the MSDN web page. I'm told the information was already in the update queue for their next online update cycle, but they also did a special one-time manual update just for me. Now I feel bad.) -Raymond]

# re: Please feel free to stop using DDE

Wednesday, February 28, 2007 10:17 PM by Dean Harding

> But I thought I'd read somewhere that Microsoft had set a corporate

> standard for the order in which its own products would display information.

I'm still not sure where you've seen '_' sort AFTER a letter, though... Unless you're thinking of the hyphen '-' and "word sorting"?

# Vista documentation

Thursday, March 01, 2007 11:43 AM by David Heffernan

Oh the power!  What an amazing feeling, to be able to influence Microsoft!

Now, I just have to find it on MSDN.....

Thanks Raymond, don't feel too guilty.

:-)

# re: Please feel free to stop using DDE

Thursday, March 01, 2007 8:18 PM by Marc Rohloff

[By "You are free to stop using DDE"]

I just ahd this discussion with someone the other day... Its great to say "don't use DDE", but what is the alternative? Even the version of Office on my machine (2003) uses DDE, how else do you get Explerer to open a second Word document without creating a whole new process and loading a second copy of Word into it?

To stay on topic: In South Africa if you get your license on an automatic you can only drive an automatic and not a stick shift.

--

Marc

[You'll have to ask the Word team. I wouldn't be surprised if they have some automation interface you can use. -Raymond]

# re: Please feel free to stop using DDE

Thursday, March 01, 2007 9:03 PM by Norman Diamond

> By "You are free to stop using DDE" I mean

> "You are free to stop writing code that

> participates in DDE conversations." This

> covers both server and client side.

Then you really do mean I should stop calling ShellExecuteEx?  Um, no, because BryanK posted a way to determine if it might be safe to call ShellExecuteEx?

> I think you once again are willfully ignoring

> my last paragraph.

Well I already understood that I have to process messages in order to avoid clogging up innocent bystanders.  So now there's an additional effect, when I process messages I also avoid clogging up guilty bystanders (users of DDE).  So what?  Since I already process messages, I'm ignoring your last paragraph?

> There is no requirement (in the United States,

> at least) that you own a manual transmission

> or even know how to operate one.

There used to be a requirement (in the United States, at least part thereof) that you know how to operate a manual transmission even if you never own one.  Maybe it's gone now though.

Wednesday, February 28, 2007 10:17 PM by Dean Harding

> I'm still not sure where you've seen '_' sort

> AFTER a letter, though... Unless you're

> thinking of the hyphen '-' and "word sorting"?

I did think I'd read that punctuation marks were supposed to be either ignored or very low ranked in their effect on sort orders.  I didn't recall reading that the hyphen would be treated differently from the underscore (and why not the apostrophe?).

Come to think of it, if a corporate policy calls for ignoring punctuation marks correctly, then two strings that differ only in punctuation could be sorted in different orders for no reason at all, and Outlook Express's sorting isn't as funny as I thought it was.  But the MSDN library's sorting still looks odd.

[You are focusing on the details of the last paragraph and missing the point. Processing messages is one example of having to be aware of DDE, not the sole example. You have to accept that other components may use DDE, and that is within their rights as well. ShellExecuteEx is one such. -Raymond]

# re: Please feel free to stop using DDE

Friday, March 02, 2007 1:54 AM by Dean Harding

> I didn't recall reading that the hyphen would be treated

> differently from the underscore (and why not the apostrophe?)

Hyphen and apostrophe are the only ones that are affected by word sorting - they're basically ignored. Other punctuation is handled the same whether you're doing word sort or string sort (in fact, string sort just makes hyphen and apostrophe work like other punctuation).

The only exception that I know of to this rule is how the period is treated in StrCmpLogicalW in Vista, to make filenames that end in numbers sort more "naturally" (whether you think StrCmpLogicalW is more "natural" or not is a matter of preference)

# re: Please feel free to stop using DDE

Thursday, March 08, 2007 5:07 PM by Morastey

Hi...

in the file-association-properties:

Example: C:\Program Files\Test\test.exe  "%1" "%2"

this would only open the first and second selected file...

is it posible to set for "%1" another command, to get all files??

# The Fifth MAPI Multithreading Rule

Friday, May 22, 2009 10:37 AM by SGriffin's MAPI Internals

We had an issue recently where DDE broadcasts were being blocked on a system. The customer noticed that

New Comments to this post are disabled
 
Page view tracker