]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't use DDEExec registry key in wxMSW wxExecute() if it's empty.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 7 Aug 2013 11:08:12 +0000 (11:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 7 Aug 2013 11:08:12 +0000 (11:08 +0000)
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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/mimetype.cpp

index 26672a0686ef3a96d3348b2e9634f6ef3d6fff1c..b500425edd27684d7fe2598ab7298c94f3a6120c 100644 (file)
@@ -574,6 +574,7 @@ All (GUI):
 wxMSW:
 
 - It is now possible to tab into radio boxes again.
+- Fix launching some types of files under Windows 7 and later (Steven Houchins).
 
 wxOSX:
 
index 658540b995d53a634cb2b3de61fd2ea705ab8c8b..9bd56ad4361e38289c5fb3ed9dc6ed8c1bdd4e4b 100644 (file)
@@ -291,23 +291,28 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const
             if ( keyDDE.Open(wxRegKey::Read) ) {
                 wxString ddeCommand, ddeServer, ddeTopic;
                 keyDDE.QueryValue(wxEmptyString, ddeCommand);
-                ddeCommand.Replace(wxT("%1"), wxT("%s"));
-
-                wxRegKey keyServer(wxRegKey::HKCR, strKey + wxT("\\Application"));
-                keyServer.QueryValue(wxEmptyString, ddeServer);
-                wxRegKey keyTopic(wxRegKey::HKCR, strKey + wxT("\\Topic"));
-                keyTopic.QueryValue(wxEmptyString, ddeTopic);
-
-                if (ddeTopic.empty())
-                    ddeTopic = wxT("System");
-
-                // HACK: we use a special feature of wxExecute which exists
-                //       just because we need it here: it will establish DDE
-                //       conversation with the program it just launched
-                command.Prepend(wxT("WX_DDE#"));
-                command << wxT('#') << ddeServer
-                        << wxT('#') << ddeTopic
-                        << wxT('#') << ddeCommand;
+
+                // in some cases "DDEExec" subkey exists but has no value, we
+                // shouldn't use DDE in this case
+                if ( !ddeCommand.empty() ) {
+                    ddeCommand.Replace(wxT("%1"), wxT("%s"));
+
+                    wxRegKey keyServer(wxRegKey::HKCR, strKey + wxT("\\Application"));
+                    keyServer.QueryValue(wxEmptyString, ddeServer);
+                    wxRegKey keyTopic(wxRegKey::HKCR, strKey + wxT("\\Topic"));
+                    keyTopic.QueryValue(wxEmptyString, ddeTopic);
+
+                    if (ddeTopic.empty())
+                        ddeTopic = wxT("System");
+
+                    // HACK: we use a special feature of wxExecute which exists
+                    //       just because we need it here: it will establish DDE
+                    //       conversation with the program it just launched
+                    command.Prepend(wxT("WX_DDE#"));
+                    command << wxT('#') << ddeServer
+                            << wxT('#') << ddeTopic
+                            << wxT('#') << ddeCommand;
+                }
             }
             else
 #endif // wxUSE_IPC