Opened 5 years ago

Closed 5 years ago

#15388 closed defect (fixed)

wxExecute fails after wxFileType::GetOpenCommand on Windows

Reported by: houchins@… Owned by:
Priority: normal Milestone:
Component: wxMSW Version: stable-latest
Keywords: DDE GetOpenCommand wxExecute Cc:
Blocked By: Blocking:
Patch: yes


My app is calling wxFileType::GetOpenCommand() to get a command string to open an html file. The subsequent wxExecute fails on Windows 7 because the returned command string has WX_DDE specifiers in it that are incomplete and thus not parsed properly by wxExecute.

The problem occurs in src/msw/mimetype.cpp when no DDE command is specified in the Windows registry. (DDE may be obsolete in newer Windows systems, but does exist in XP). Specifically, the key "HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec" does not contain a Default value (it is empty). The wxWidgets code in GetCommand() does not check for an empty 'ddeexec' string, and thus what is returned is malformed causing the error.

I have a patch which simply checks for an empty DDECommand string and bypasses adding DDE specifiers to the command if so.

Attachments (1)

mimetype.patch download (2.7 KB) - added by houchins@… 5 years ago.
patch file

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by houchins@…

patch file

comment:1 Changed 5 years ago by houchins@…

  • Version changed from 2.9.3 to 2.9-svn

comment:2 Changed 5 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [74636]) Don't use DDEExec registry key in wxMSW wxExecute() if it's empty.

Some file types have DDEExec subkey in the registry but no value for it, don't
use DDE for launching the files of these types in this case as this only
results in errors.

Closes #15388.

Note: See TracTickets for help on using tickets.