]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mimetype.cpp
Upgrade bundled zlib to 1.2.8.
[wxWidgets.git] / src / msw / mimetype.cpp
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